enso-org / enso

Hybrid visual and textual functional programming.
https://ensoanalytics.com
Apache License 2.0
7.36k stars 324 forks source link

Name.Blank causes "Unexpected internal error" after adding a return type #11090

Closed AdRiley closed 1 month ago

AdRiley commented 1 month ago

This change https://github.com/enso-org/enso/pull/11086/files has resulted in

Error: de_ci::program::command: sbt ℹ️ [ERROR] [2024-09-16T13:11:10.305] [org.enso.runner.Main] Unexpected internal error INFO ide_ci::program::command: sbt ℹ️ org.graalvm.polyglot.PolyglotException: org.enso.compiler.core.CompilerError: Compiler Internal Error: Blanks should not be present during dataflow analysis.

https://github.com/enso-org/enso/actions/runs/10882555757/job/30193845599?pr=11086#step:7:1077

JaroslavTulach commented 1 month ago

Found the fix:

enso$ git diff engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/desugar/LambdaShorthandToLambda.scala
diff --git engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/desugar/LambdaShorthandToLambda.scala engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/desugar/LambdaShorthandToLambda.scala
index 49f92cfd85..9a0dee2518 100644
--- engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/desugar/LambdaShorthandToLambda.scala
+++ engine/runtime-compiler/src/main/scala/org/enso/compiler/pass/desugar/LambdaShorthandToLambda.scala
@@ -8,8 +8,7 @@ import org.enso.compiler.core.ir.{
   Function,
   IdentifiedLocation,
   Module,
-  Name,
-  Type
+  Name
 }
 import org.enso.compiler.core.CompilerError
 import org.enso.compiler.core.ir.expression.{Application, Case, Operator}
@@ -72,7 +71,6 @@ case object LambdaShorthandToLambda extends IRPass {
     moduleContext: ModuleContext
   ): Module = {
     val new_bindings = ir.bindings.map {
-      case asc: Type.Ascription => asc
       case a =>
         a.mapExpressions(
           runExpression(
@@ -123,7 +121,6 @@ case object LambdaShorthandToLambda extends IRPass {
     freshNameSupply: FreshNameSupply
   ): Expression = {
     ir.transformExpressions {
-      case asc: Type.Ascription => asc
       case app: Application     => desugarApplication(app, freshNameSupply)
       case caseExpr: Case.Expr  => desugarCaseExpr(caseExpr, freshNameSupply)
       case name: Name           => desugarName(name, freshNameSupply)
enso-bot[bot] commented 4 weeks ago

Jaroslav Tulach reports a new STANDUP for yesterday (2024-09-24):

Progress: .