mirror of
https://github.com/enso-org/enso.git
synced 2024-12-24 08:12:06 +03:00
Return Correct Name for the Module in AtomConstructor (#1375)
return the module name if it's the atom constructor of the module.
This commit is contained in:
parent
03f3c2b661
commit
e2b583c64a
@ -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.")
|
||||
|
@ -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. */
|
||||
|
@ -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]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user