diff options
author | paltherr <paltherr@epfl.ch> | 2003-12-11 13:28:34 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-12-11 13:28:34 +0000 |
commit | 68ed8693e99e0fffc454030c8eb73567ef23e33c (patch) | |
tree | d6d33b483f1680242681b057dc4858a1956d7b14 | |
parent | 5b88042e49dc804423d1f40473ebcef1768115a0 (diff) | |
download | scala-68ed8693e99e0fffc454030c8eb73567ef23e33c.tar.gz scala-68ed8693e99e0fffc454030c8eb73567ef23e33c.tar.bz2 scala-68ed8693e99e0fffc454030c8eb73567ef23e33c.zip |
- Added assertions on parameters of MethodTypes...
- Added assertions on parameters of MethodTypes and PolyTypes
-rw-r--r-- | sources/scalac/symtab/Type.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index 021479e116..d7670a4aed 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -75,7 +75,10 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { /** synthetic type of a method def ...(vparams): result = ... */ - public case MethodType(Symbol[] vparams, Type result); + public case MethodType(Symbol[] vparams, Type result) { + for (int i = 0; i < vparams.length; i++) + assert vparams[i].isParameter() && vparams[i].isTerm(): this; + } /** synthetic type of a method def ...[tparams]result * For instance, given def f[a](x: a): a @@ -87,7 +90,10 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { * For instance, given def f = 1 * f has type PolyType(new Symbol[]{}, <scala.Int>.type()) */ - public case PolyType(Symbol[] tparams, Type result); + public case PolyType(Symbol[] tparams, Type result) { + for (int i = 0; i < tparams.length; i++) + assert tparams[i].isParameter()&&tparams[i].isAbstractType(): this; + } /** synthetic type of an overloaded value whose alternatives are * alts_1, ..., alts_n, with respective types alttypes_1, ..., alttypes_n |