summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-01-07 16:28:24 +0000
committerpaltherr <paltherr@epfl.ch>2004-01-07 16:28:24 +0000
commitb05601a61b5ff8783cac2a47ae7ed3fe3430055b (patch)
treeb675d0b95670b9d3d9498703429b0ceb3d9e8191 /sources/scalac/symtab
parent836f5fbd907fe00bd9bd3849f1d41b13c2afd53a (diff)
downloadscala-b05601a61b5ff8783cac2a47ae7ed3fe3430055b.tar.gz
scala-b05601a61b5ff8783cac2a47ae7ed3fe3430055b.tar.bz2
scala-b05601a61b5ff8783cac2a47ae7ed3fe3430055b.zip
- Added correct owner to non-class compound types
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r--sources/scalac/symtab/Type.java10
-rw-r--r--sources/scalac/symtab/classfile/Pickle.java6
-rw-r--r--sources/scalac/symtab/classfile/UnPickle.java8
3 files changed, 9 insertions, 15 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index e8ed6058a3..b47ec08ab9 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -213,10 +213,10 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
return res;
}
- public static CompoundType compoundType(Type[] parts, Scope members) {
+ public static CompoundType compoundTypeWithOwner(Symbol owner, Type[] parts, Scope members) {
ExtCompoundType res = new ExtCompoundType(parts, members);
res.tsym = new ClassSymbol(
- Position.FIRSTPOS, Names.COMPOUND_NAME.toTypeName(), Symbol.NONE,
+ Position.FIRSTPOS, Names.COMPOUND_NAME.toTypeName(), owner,
SYNTHETIC | ABSTRACT);
res.tsym.setInfo(res);
res.tsym.primaryConstructor().setInfo(
@@ -1039,7 +1039,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
} else {
Scope members2 = new Scope();
//Type tp1 = compoundType(parts1, members2);
- Type tp1 = (tp.symbol().isCompoundSym()) ? compoundType(parts1, members2)
+ Type tp1 = (tp.symbol().isCompoundSym()) ? compoundTypeWithOwner(tp.symbol().owner(), parts1, members2)
: compoundType(parts1, members2, tp.symbol());
Symbol[] syms1 = members1.elements();
Symbol[] syms2 = new Symbol[syms1.length];
@@ -2578,7 +2578,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
// add refinements where necessary
Scope members = new Scope();
- Type lubType = compoundType(leastBaseTypes, members);
+ Type lubType = compoundTypeWithOwner(Symbol.NONE, leastBaseTypes, members); // !!! NONE
/*
Type lubThisType = lubType.narrow();
//System.out.println("lubtype = " + lubType);//DEBUG
@@ -2751,7 +2751,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags {
}
}
- CompoundType glbType = compoundType(Type.EMPTY_ARRAY, new Scope());
+ CompoundType glbType = compoundTypeWithOwner(Symbol.NONE, Type.EMPTY_ARRAY, new Scope()); // !!! NONE
Type glbThisType = glbType.narrow();
// step 3: compute glb of all refinements.
diff --git a/sources/scalac/symtab/classfile/Pickle.java b/sources/scalac/symtab/classfile/Pickle.java
index 3a3747822b..7309f4d8d7 100644
--- a/sources/scalac/symtab/classfile/Pickle.java
+++ b/sources/scalac/symtab/classfile/Pickle.java
@@ -179,8 +179,7 @@ public class Pickle implements Kinds, Modifiers, EntryTags {
putTypes(args);
break;
case CompoundType(Type[] parents, Scope members):
- if (!tp.symbol().isCompoundSym())
- putSymbol(tp.symbol());
+ putSymbol(tp.symbol());
putTypes(parents);
break;
case MethodType(Symbol[] vparams, Type result):
@@ -409,8 +408,7 @@ public class Pickle implements Kinds, Modifiers, EntryTags {
case CompoundType(Type[] parents, Scope members):
writeByte(COMPOUNDtpe);
writeByte(0); // space for length
- if (!tp.symbol().isCompoundSym())
- writeRef(tp.symbol());
+ writeRef(tp.symbol());
writeRefs(parents);
break;
diff --git a/sources/scalac/symtab/classfile/UnPickle.java b/sources/scalac/symtab/classfile/UnPickle.java
index 905e5a8b22..028c5a1ecd 100644
--- a/sources/scalac/symtab/classfile/UnPickle.java
+++ b/sources/scalac/symtab/classfile/UnPickle.java
@@ -347,13 +347,9 @@ public class UnPickle implements Kinds, Modifiers, EntryTags, TypeTags {
break;
case COMPOUNDtpe:
Symbol[] clazzs = readSymbolRefs(end);
+ assert clazzs.length == 1;
Type[] parents = readTypeRefs(end);
- if (clazzs.length == 0) {
- tpe = Type.compoundType(parents, new Scope());
- } else {
- assert clazzs.length == 1;
- tpe = Type.compoundType(parents, new Scope(), clazzs[0]);
- }
+ tpe = Type.compoundType(parents, new Scope(), clazzs[0]);
break;
case METHODtpe:
Type restype = readTypeRef();