Skip to content

Commit

Permalink
make compilable
Browse files Browse the repository at this point in the history
  • Loading branch information
denhie committed Jun 20, 2023
1 parent 45d1d1f commit 8e31679
Show file tree
Hide file tree
Showing 23 changed files with 178 additions and 95 deletions.
8 changes: 0 additions & 8 deletions effekt/jvm/src/main/scala/effekt/EffektConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ class EffektConfig(args: Seq[String]) extends REPLConfig(args) {
noshort = true
)

val no_optimize: ScallopOption[String] = choice(
choices = List("none", "all", "inlining", "sat", "beta", "dead"),
name = "no_optimize",
descr = "Optimizations that should not be used",
default = Some("none"),
noshort = true
)

val llvmVersion: ScallopOption[String] = opt[String](
"llvm-version",
descr = "the llvm version that should be used to compile the generated programs (only necessary if backend is llvm, defaults to 12)",
Expand Down
2 changes: 1 addition & 1 deletion effekt/jvm/src/main/scala/effekt/Repl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class Repl(driver: Driver) extends REPL[Tree, EffektConfig, EffektError] {
*/
def make(expr: Term): ModuleDecl = {

val body = Return(expr)
val body = Return(List(expr))

ModuleDecl("interactive", imports,
definitions :+ FunDef(IdDef("main"), Nil, Nil, Nil, None,
Expand Down
5 changes: 4 additions & 1 deletion effekt/jvm/src/main/scala/effekt/Server.scala
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ trait LSPServer extends kiama.util.Server[Tree, EffektConfig, EffektError] with
result <- fun.symbol.annotatedResult
effects <- fun.symbol.annotatedEffects
} yield (result, effects)
if ann.map { needsUpdate(_, (tpe, eff)) }.getOrElse(true)
if ann.map {
case (List(y), eff1) => needsUpdate((y, eff1), (tpe, eff))
case _ => ??? // TODO MRV
}.getOrElse(true)
res <- CodeAction("Update return type with inferred effects", fun.ret, s": $tpe / $eff")
} yield res

Expand Down
6 changes: 3 additions & 3 deletions effekt/shared/src/main/scala/effekt/Namer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ object Namer extends Phase[Parsed, NameResolved] {

val res = resolve(ret)

FunctionType(tps, cps, vps, bps, res, effs)
FunctionType(tps, cps, vps, bps, List(res), effs) // TODO MRV remove List(res)
}
}

Expand Down Expand Up @@ -640,8 +640,8 @@ object Namer extends Phase[Parsed, NameResolved] {
def resolve(tpe: source.Effects)(using Context): Effects =
Effects(tpe.effs.flatMap(resolveWithAliases).toSeq: _*) // TODO this otherwise is calling the wrong apply

def resolve(e: source.Effectful)(using Context): (ValueType, Effects) =
(resolve(e.tpe), resolve(e.eff))
def resolve(e: source.Effectful)(using Context): (List[ValueType], Effects) =
(e.tpe map resolve, resolve(e.eff))

def resolve(capt: source.CaptureSet)(using Context): CaptureSet = {
val captResolved = CaptureSet(capt.captures.map { Context.resolveCapture }.toSet)
Expand Down
Loading

0 comments on commit 8e31679

Please sign in to comment.