Skip to content

Commit 5cf0011

Browse files
committed
further bargs fixing
1 parent d6bb3fc commit 5cf0011

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,22 @@ object ArityRaising extends Phase[CoreTransformed, CoreTransformed] {
108108
case BlockVar(id, annotatedTpe, annotatedCapt) =>
109109
annotatedTpe match {
110110
case BlockType.Function(tparams, cparams, vparams, bparams, result) =>
111-
val params = vparams.map { tpe =>
112-
// need to fix for propper implementation
113-
val freshId = Id("x_" + scala.util.Random.nextInt())
111+
val types = tparams.map {id =>
112+
113+
}
114+
val values = vparams.map { tpe =>
115+
val freshId = Id("x")
114116
(ValueParam(freshId, tpe), ValueVar(freshId, tpe))
115117
}
116-
val call = Stmt.App(barg, List(), params.map(_._2), List())
118+
val blocks = bparams.zip(cparams).map { case (tpe, capt)=>
119+
val freshId = Id("f")
120+
(BlockParam(freshId, tpe, Set(capt)), BlockVar(freshId, tpe, Set(capt)))
121+
}
122+
123+
val call = Stmt.App(barg, List(), values.map(_._2), List())
117124
val transformedBody = transform(call)
118125

119-
// empty List for Bargs should be fine, since myList.map {myFunc} the myFunc cant have any bargs??
120-
BlockLit(tparams, cparams, params.map(_._1), List(), transformedBody)
126+
BlockLit(tparams, cparams, values.map(_._1), List(), transformedBody)
121127

122128
case _ => transform(barg)
123129
}

project/metals.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This plugin enables semantic information to be produced by sbt.
55
// It also adds support for debugging using the Debug Adapter Protocol
66

7-
addSbtPlugin("org.scalameta" % "sbt-metals" % "1.6.3")
7+
addSbtPlugin("org.scalameta" % "sbt-metals" % "1.6.4")
88

99
// This plugin adds the BSP debug capability to sbt server.
1010

project/project/metals.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This plugin enables semantic information to be produced by sbt.
55
// It also adds support for debugging using the Debug Adapter Protocol
66

7-
addSbtPlugin("org.scalameta" % "sbt-metals" % "1.6.3")
7+
addSbtPlugin("org.scalameta" % "sbt-metals" % "1.6.4")
88

99
// This plugin makes sure that the JDI tools are in the sbt classpath.
1010
// JDI tools are used by the debug adapter server.

0 commit comments

Comments
 (0)