diff options
-rw-r--r-- | sources/scalac/symtab/Definitions.java | 8 | ||||
-rw-r--r-- | sources/scalac/transformer/TypesAsValuesPhase.java | 5 | ||||
-rw-r--r-- | sources/scalac/util/Names.java | 1 |
3 files changed, 10 insertions, 4 deletions
diff --git a/sources/scalac/symtab/Definitions.java b/sources/scalac/symtab/Definitions.java index 068590b7ec..a5b3951ac8 100644 --- a/sources/scalac/symtab/Definitions.java +++ b/sources/scalac/symtab/Definitions.java @@ -669,6 +669,14 @@ public class Definitions { return TYPECONSTRUCTOR_INSTANTIATE; } + private Symbol TYPECONSTRUCTOR_FUNCTIONOUTER; + public Symbol TYPECONSTRUCTOR_FUNCTIONOUTER() { + if (TYPECONSTRUCTOR_FUNCTIONOUTER == null) + TYPECONSTRUCTOR_FUNCTIONOUTER = + loadTerm(TYPECONSTRUCTOR_CLASS.linkedModule().moduleClass(), Names.functionOuter); + return TYPECONSTRUCTOR_FUNCTIONOUTER; + } + private Symbol SCALACLASSTYPE_SETPARENTS; public Symbol SCALACLASSTYPE_SETPARENTS() { if (SCALACLASSTYPE_SETPARENTS == null) diff --git a/sources/scalac/transformer/TypesAsValuesPhase.java b/sources/scalac/transformer/TypesAsValuesPhase.java index 9324daace8..6eea866c11 100644 --- a/sources/scalac/transformer/TypesAsValuesPhase.java +++ b/sources/scalac/transformer/TypesAsValuesPhase.java @@ -592,8 +592,7 @@ public class TypesAsValuesPhase extends Phase { Tree outer = isNestedClass(clsSym) ? (clsSym.owner().isClass() ? gen.This(pos, clsSym.owner()) - : gen.New(gen.mkApply__(gen.mkPrimaryConstructorGlobalRef(pos, - defs.OBJECT_CLASS)))) + : gen.mkGlobalRef(pos, defs.TYPECONSTRUCTOR_FUNCTIONOUTER())) : gen.mkNullLit(pos); Tree[] tcArgs = new Tree[] { @@ -794,8 +793,6 @@ public class TypesAsValuesPhase extends Phase { return javaType(pos, sym); } else if (!sym.isParameter()) { // Reference to a "global" type. - if (owner == null) - throw new Error("null owner for " + Debug.show(tp)); return scalaClassType(pos, tp, owner, env); } else { assert !isValuePrefix(pre) : tp; diff --git a/sources/scalac/util/Names.java b/sources/scalac/util/Names.java index 43b8953830..c2e759920c 100644 --- a/sources/scalac/util/Names.java +++ b/sources/scalac/util/Names.java @@ -175,6 +175,7 @@ public class Names { public static final Name finalize = Name.fromString("finalize"); public static final Name flatmap = Name.fromString("flatMap"); public static final Name foreach = Name.fromString("foreach"); + public static final Name functionOuter = Name.fromString("FUNCTION_OUTER"); public static final Name get = Name.fromString("get"); public static final Name getClass = Name.fromString("getClass"); public static final Name getInstantiation = Name.fromString("getInstantiation"); |