summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-10-27 10:10:15 +0000
committerpaltherr <paltherr@epfl.ch>2003-10-27 10:10:15 +0000
commit7a7fd08c62fa7dcbe36707a1483416a150d1640b (patch)
tree71218c133233a4a82cabeb223eada5b214b57ad8 /sources
parent22601538e7dcc7005f46890993227e99a47020b5 (diff)
downloadscala-7a7fd08c62fa7dcbe36707a1483416a150d1640b.tar.gz
scala-7a7fd08c62fa7dcbe36707a1483416a150d1640b.tar.bz2
scala-7a7fd08c62fa7dcbe36707a1483416a150d1640b.zip
- Expresssed TypeSymbol.type() in terms of prim...
- Expresssed TypeSymbol.type() in terms of primaryConstructor().type() - Fixed return type of AbsTypeSymbol primary constructors Added - possibility to remove this types
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/symtab/Symbol.java18
1 files changed, 3 insertions, 15 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 6e4cf0d874..2a258dd9f7 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -1480,20 +1480,7 @@ public abstract class TypeSymbol extends Symbol {
/** Get type */
public Type type() {
- Symbol[] tparams = typeParams();
- if (template != null) {
- switch (template) {
- case TypeRef(_, _, Type[] targs):
- if (targs.length == tparams.length)
- return template;
- }
- }
- if (tparams.length == 0)
- template = typeConstructor();
- else
- template = Type.TypeRef(
- owner().thisType(), this, type(tparams));
- return template;
+ return primaryConstructor().type().resultType();
}
/**
@@ -1633,7 +1620,7 @@ public class AbsTypeSymbol extends TypeSymbol {
/** Constructor */
public AbsTypeSymbol(int pos, Name name, Symbol owner, int flags) {
super(TYPE, pos, name, owner, flags);
- allConstructors().setType(Type.MethodType(EMPTY_ARRAY, thisType()));
+ allConstructors().setFirstInfo(Type.MethodType(EMPTY_ARRAY, Type.TypeRef(owner.thisType(), this, Type.EMPTY_ARRAY)));
}
public static AbsTypeSymbol define(
@@ -1805,6 +1792,7 @@ public class ClassSymbol extends TypeSymbol {
}
public Symbol setTypeOfThis(Type tp) {
+ if (tp == Type.NoType) { thisSym = this; return this; }
thisSym = new TermSymbol(this.pos, Names.this_, this, SYNTHETIC);
thisSym.setInfo(tp);
return this;