summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-07-15 12:29:30 +0000
committerpaltherr <paltherr@epfl.ch>2003-07-15 12:29:30 +0000
commit13885930bedd7065397f9a268d50dbdb8e8febd3 (patch)
tree73e778e7cc5dff7fd0092590e708e3cd68ec9565
parent3279825ba3936a9d1f9c7a953fb23d604177fd7c (diff)
downloadscala-13885930bedd7065397f9a268d50dbdb8e8febd3.tar.gz
scala-13885930bedd7065397f9a268d50dbdb8e8febd3.tar.bz2
scala-13885930bedd7065397f9a268d50dbdb8e8febd3.zip
- Removed "case TypeRef(...)" from method Type....
- Removed "case TypeRef(...)" from method Type.typeParams and Type.valueParams (fixes at least one bug in lambdalift). - Fixed code in Analyzer which relied on the "case TypeRef(...)"
-rw-r--r--sources/scalac/symtab/Type.java15
-rw-r--r--sources/scalac/typechecker/Analyzer.java4
2 files changed, 7 insertions, 12 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java
index 45e32dfda3..61cd77c300 100644
--- a/sources/scalac/symtab/Type.java
+++ b/sources/scalac/symtab/Type.java
@@ -411,21 +411,19 @@ public class Type implements Modifiers, Kinds, TypeTags {
}
}
- /** Get type parameters of polymorphic method or class
- * or EMPTY_ARRAY if not applicable.
+ /** Get type parameters of polymorphic method or EMPTY_ARRAY if
+ * not applicable.
*/
public Symbol[] typeParams() {
switch (this) {
case PolyType(Symbol[] tparams, _):
return tparams;
- case TypeRef(_, Symbol sym, _):
- if (sym.kind == CLASS) return sym.typeParams();
- else return sym.info().typeParams();
+ default:
+ return Symbol.EMPTY_ARRAY;
}
- return Symbol.EMPTY_ARRAY;
}
- /** Get value parameters of method or class or EMPTY_ARRAY if not
+ /** Get value parameters of method or EMPTY_ARRAY if not
* applicable.
*/
public Symbol[] valueParams() {
@@ -434,9 +432,6 @@ public class Type implements Modifiers, Kinds, TypeTags {
return result.valueParams();
case MethodType(Symbol[] vparams, _):
return vparams;
- case TypeRef(_, Symbol sym, _):
- if (sym.kind == CLASS) return sym.valueParams();
- else return sym.info().valueParams();
default:
return Symbol.EMPTY_ARRAY;
}
diff --git a/sources/scalac/typechecker/Analyzer.java b/sources/scalac/typechecker/Analyzer.java
index e72365ab16..a5b55e18b2 100644
--- a/sources/scalac/typechecker/Analyzer.java
+++ b/sources/scalac/typechecker/Analyzer.java
@@ -2204,8 +2204,8 @@ public class Analyzer extends Transformer implements Modifiers, Kinds {
Type[] argtypes = Tree.typeOf(args);
//todo: this needs to be refined.
Symbol[] tparams =
- (Type.isSameAs(tpe1.type.typeArgs(), Symbol.type(tpe1.type.typeParams())))
- ? tpe1.type.typeParams()
+ (Type.isSameAs(tpe1.type.typeArgs(), Symbol.type(tpe1.type.unalias().symbol().typeParams())))
+ ? tpe1.type.unalias().symbol().typeParams()
: Symbol.EMPTY_ARRAY;
Type owntype = Type.ErrorType;
if (tpe1.type != Type.ErrorType) {