From e2b583c64a66dd9d1bd5c8cfb34ee77acd9dbf8f Mon Sep 17 00:00:00 2001 From: Dmitry Bushev Date: Mon, 11 Jan 2021 14:29:50 +0300 Subject: [PATCH] Return Correct Name for the Module in AtomConstructor (#1375) return the module name if it's the atom constructor of the module. --- .../java/org/enso/interpreter/node/MethodRootNode.java | 4 ---- .../runtime/callable/atom/AtomConstructor.java | 8 ++++++-- lib/rust/parser/Cargo.toml | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/node/MethodRootNode.java b/engine/runtime/src/main/java/org/enso/interpreter/node/MethodRootNode.java index 15d6e91f065..82c4b522056 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/node/MethodRootNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/node/MethodRootNode.java @@ -1,16 +1,12 @@ package org.enso.interpreter.node; import com.oracle.truffle.api.dsl.ReportPolymorphism; -import com.oracle.truffle.api.frame.FrameUtil; -import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.nodes.NodeInfo; import com.oracle.truffle.api.source.SourceSection; import org.enso.interpreter.Language; import org.enso.interpreter.runtime.callable.atom.AtomConstructor; -import org.enso.interpreter.runtime.callable.function.Function; import org.enso.interpreter.runtime.scope.LocalScope; import org.enso.interpreter.runtime.scope.ModuleScope; -import org.enso.interpreter.runtime.state.Stateful; @ReportPolymorphism @NodeInfo(shortName = "Method", description = "A root node for Enso methods.") diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java index a09b6d13b8e..4cdf16ec06f 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/callable/atom/AtomConstructor.java @@ -23,7 +23,7 @@ import org.enso.pkg.QualifiedName; /** A representation of an Atom constructor. */ @ExportLibrary(InteropLibrary.class) -public class AtomConstructor implements TruffleObject { +public final class AtomConstructor implements TruffleObject { private final String name; private final ModuleScope definitionScope; @@ -200,7 +200,11 @@ public class AtomConstructor implements TruffleObject { /** @return the fully qualified name of this constructor. */ public QualifiedName getQualifiedName() { - return definitionScope.getModule().getName().createChild(getName()); + if (this == this.getDefinitionScope().getAssociatedType()) { + return definitionScope.getModule().getName(); + } else { + return definitionScope.getModule().getName().createChild(getName()); + } } /** @return the fields defined by this constructor. */ diff --git a/lib/rust/parser/Cargo.toml b/lib/rust/parser/Cargo.toml index e6132e79365..713e5a99326 100644 --- a/lib/rust/parser/Cargo.toml +++ b/lib/rust/parser/Cargo.toml @@ -17,6 +17,9 @@ enso-logger = { version = "0.1.3" } enso-prelude = { version = "0.1.8" } lexer = { version = "0.1.0", path = "../lexer/generation" } itertools = { version = "0.9.0" } +# Pinned packages +# TODO: [DB] Remove after switching to new Rust toolchain version. +anyhow = { version = "<=1.0.37" } [build-dependencies]