From 29c5fa095f74954aaa673b01a86f95fff1a6f0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Wa=C5=9Bko?= Date: Fri, 27 Dec 2024 14:49:00 +0100 Subject: [PATCH] fixes after merge to make it compile --- .../BuildScopeFromModuleAlgorithm.java | 4 ++-- .../interpreter/runtime/scope/ModuleScope.java | 2 +- .../enso/interpreter/runtime/IrToTruffle.scala | 18 +++++++----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/engine/runtime-compiler/src/main/java/org/enso/compiler/common_logic/BuildScopeFromModuleAlgorithm.java b/engine/runtime-compiler/src/main/java/org/enso/compiler/common_logic/BuildScopeFromModuleAlgorithm.java index 7cffd84cb600..9ee939096264 100644 --- a/engine/runtime-compiler/src/main/java/org/enso/compiler/common_logic/BuildScopeFromModuleAlgorithm.java +++ b/engine/runtime-compiler/src/main/java/org/enso/compiler/common_logic/BuildScopeFromModuleAlgorithm.java @@ -6,7 +6,7 @@ import org.enso.compiler.core.ir.module.scope.definition.Method; import org.enso.compiler.core.ir.module.scope.imports.Polyglot; import org.enso.compiler.data.BindingsMap; -import org.enso.compiler.pass.resolve.MethodDefinitions$; +import org.enso.compiler.pass.resolve.MethodDefinitions; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import scala.jdk.javaapi.CollectionConverters; @@ -136,7 +136,7 @@ protected final TypeScopeReferenceType getTypeAssociatedWithMethod(Method.Explic } else { var metadata = MetadataInteropHelpers.getMetadataOrNull( - typePointerOpt.get(), MethodDefinitions$.MODULE$, BindingsMap.Resolution.class); + typePointerOpt.get(), MethodDefinitions.INSTANCE, BindingsMap.Resolution.class); if (metadata == null) { logger.debug( "Failed to resolve type pointer for method: {}", method.methodReference().showCode()); diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java index a6d8a734b490..1c4f8117f95e 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/scope/ModuleScope.java @@ -23,7 +23,7 @@ /** A representation of Enso's per-file top-level scope. */ @ExportLibrary(TypesLibrary.class) -public final class ModuleScope extends EnsoObject implements EnsoObject, CommonModuleScopeShape { +public final class ModuleScope extends EnsoObject implements CommonModuleScopeShape { private final Type associatedType; private final Module module; private final Map> polyglotSymbols; diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala b/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala index 9a8b0fb00850..6eca5865e07c 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/runtime/IrToTruffle.scala @@ -29,10 +29,6 @@ import org.enso.compiler.core.ir.{ Type => Tpe } import org.enso.compiler.core.ir.module.scope.Definition -import org.enso.compiler.core.ir.module.scope.definition -import org.enso.compiler.core.ir.module.scope.Import -import org.enso.compiler.core.ir.module.scope.imports -import org.enso.compiler.core.ir.Name.Special import org.enso.compiler.core.ir.expression.{ errors, Application, @@ -210,7 +206,7 @@ class IrToTruffle( visibleName: String, javaClassName: String ): Unit = - scopeBuilder.registerPolyglotSymbol( + this.scopeBuilder.registerPolyglotSymbol( visibleName, () => context.lookupJavaClass(javaClassName) ) @@ -256,16 +252,16 @@ class IrToTruffle( conversion.methodName.name, fn.arguments, fn.body, - ReadArgumentCheckNode.build(context, "conversion", toType), + TypeCheckValueNode.single("conversion", toType), None, true ) val rootNode = MethodRootNode.build( language, expressionProcessor.scope, - scopeBuilder.asModuleScope(), + this.scopeBuilder.asModuleScope(), () => bodyBuilder.bodyNode(), - makeSection(scopeBuilder.getModule, conversion.location), + makeSection(this.scopeBuilder.getModule, conversion.location), toType, conversion.methodName.name ) @@ -285,7 +281,7 @@ class IrToTruffle( "Conversion bodies must be functions at the point of codegen." ) } - scopeBuilder.registerConversionMethod(toType, fromType, function) + this.scopeBuilder.registerConversionMethod(toType, fromType, function) } } @@ -332,7 +328,7 @@ class IrToTruffle( frameInfo ) - scopeBuilder.registerMethod( + this.scopeBuilder.registerMethod( cons, method.methodName.name, () => { @@ -350,7 +346,7 @@ class IrToTruffle( override protected def processTypeDefinition(typ: Definition.Type): Unit = { val atomDefs = typ.members - val asType = scopeBuilder.asModuleScope().getType(typ.name.name, true) + val asType = this.scopeBuilder.asModuleScope().getType(typ.name.name, true) val atomConstructors = atomDefs.map(cons => asType.getConstructors.get(cons.name.name)) atomConstructors