Skip to content

Commit a97ec28

Browse files
committed
need to use fresh
1 parent 3a8a324 commit a97ec28

File tree

4 files changed

+39
-2
lines changed

4 files changed

+39
-2
lines changed

effekt/shared/src/main/scala/effekt/core/ArityRaising.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ object ArityRaising extends Phase[CoreTransformed, CoreTransformed] {
3333
DC.findData(name) match {
3434
case Some(Data(_, List(), List(Constructor(test, List(), List(Field(x, tpe1), Field(y, tpe2)))))) =>
3535
println(test)
36+
//new names
3637
val vparams = List(ValueParam(x, tpe1), ValueParam(y, tpe2))
3738
val transformedBody = Let(param, ValueType.Data(name, targs),
3839
Make(ValueType.Data(name, targs), test, List(), List(ValueVar(x, tpe1), ValueVar(y, tpe2))), transform(body))
@@ -84,9 +85,10 @@ object ArityRaising extends Phase[CoreTransformed, CoreTransformed] {
8485
println(annotatedCapt)
8586
DC.findData(name) match {
8687
case Some(Data(_, List(), List(Constructor(test, List(), List(Field(x, tpe1), Field(y, tpe2)))))) =>
87-
val transformedVargs = List(ValueVar(x, tpe1), ValueVar(y, tpe2))
88+
val xfresh = Id(x.name)
89+
val transformedVargs = List(ValueVar(xfresh, tpe1), ValueVar(y, tpe2))
8890
val res = Stmt.App(BlockVar(id, BlockType.Function(List(), List(), List(tpe1, tpe2), List(), returnTpe), annotatedCapt), targs, transformedVargs, bargs)
89-
val latermatch: BlockLit = Block.BlockLit(List(), List(), List(ValueParam(x,tpe1), ValueParam(y, tpe2)), List(), res)
91+
val latermatch: BlockLit = Block.BlockLit(List(), List(), List(ValueParam(xfresh,tpe1), ValueParam(y, tpe2)), List(), res)
9092
val newMatch = Stmt.Match(vargs.head, List((test, latermatch)), None)
9193
println("res $$$$###")
9294
println(stmt)

project/metals.sbt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// format: off
2+
// DO NOT EDIT! This file is auto-generated.
3+
4+
// This plugin enables semantic information to be produced by sbt.
5+
// It also adds support for debugging using the Debug Adapter Protocol
6+
7+
addSbtPlugin("org.scalameta" % "sbt-metals" % "1.6.3")
8+
9+
// This plugin adds the BSP debug capability to sbt server.
10+
11+
addSbtPlugin("ch.epfl.scala" % "sbt-debug-adapter" % "4.2.8")
12+
13+
// format: on

project/project/metals.sbt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// format: off
2+
// DO NOT EDIT! This file is auto-generated.
3+
4+
// This plugin enables semantic information to be produced by sbt.
5+
// It also adds support for debugging using the Debug Adapter Protocol
6+
7+
addSbtPlugin("org.scalameta" % "sbt-metals" % "1.6.3")
8+
9+
// This plugin makes sure that the JDI tools are in the sbt classpath.
10+
// JDI tools are used by the debug adapter server.
11+
12+
addSbtPlugin("com.github.sbt" % "sbt-jdi-tools" % "1.2.0")
13+
14+
// format: on

project/project/project/metals.sbt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// format: off
2+
// DO NOT EDIT! This file is auto-generated.
3+
4+
// This file enables sbt-bloop to create bloop config files.
5+
6+
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "2.0.13")
7+
8+
// format: on

0 commit comments

Comments
 (0)