diff --git a/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/types/TypeInference.java b/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/types/TypeInference.java index 42f735106c0b..0d56c6fda9c6 100644 --- a/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/types/TypeInference.java +++ b/engine/runtime-compiler/src/main/java/org/enso/compiler/pass/analyse/types/TypeInference.java @@ -16,6 +16,7 @@ import org.enso.compiler.pass.analyse.BindingAnalysis$; import org.enso.compiler.pass.analyse.JavaInteropHelpers; import org.enso.compiler.pass.resolve.*; +import org.enso.persist.Persistance; import org.enso.pkg.QualifiedName; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -470,6 +471,10 @@ private InferredType getInferredType(Expression expression) { } } + private TypeRepresentation resolveTypeExpression(Persistance.Reference ref) { + return resolveTypeExpression(ref.get(Expression.class)); + } + private TypeRepresentation resolveTypeExpression(Expression type) { return switch (type) { case Name.Literal name -> { diff --git a/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala b/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala index 136c27a327d3..30b2dd6cd420 100644 --- a/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala +++ b/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala @@ -13,6 +13,7 @@ import org.enso.compiler.core.ir.module.scope.Definition import org.enso.compiler.pass.IRPass import org.enso.compiler.pass.analyse.BindingAnalysis import org.enso.compiler.pass.resolve.MethodDefinitions +import org.enso.persist.Persistance.Reference import org.enso.pkg.QualifiedName import java.io.ObjectOutputStream @@ -746,7 +747,7 @@ object BindingsMap { def anyFieldsDefaulted: Boolean = arguments.exists(_.hasDefaultValue) } - case class Argument(name: String, hasDefaultValue: Boolean, typ: Option[Expression]) + case class Argument(name: String, hasDefaultValue: Boolean, typ: Option[Reference[Expression]]) /** A representation of a sum type * @@ -782,9 +783,13 @@ object BindingsMap { ir.members.map(m => Cons( m.name.name, - m.arguments.map(arg => - BindingsMap.Argument(arg.name.name, arg.defaultValue.isDefined, arg.ascribedType) - ) + m.arguments.map { arg => + val ascribedType: Option[Reference[Expression]] = arg.ascribedType match { + case Some(value) => Some(Reference.of(value)) + case None => None + } + BindingsMap.Argument(arg.name.name, arg.defaultValue.isDefined, ascribedType) + } ) ), isBuiltinType