diff options
author | schinz <schinz@epfl.ch> | 2005-01-17 14:36:05 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2005-01-17 14:36:05 +0000 |
commit | 45a2a1519be139933decb29558f34486191b7838 (patch) | |
tree | bb4d1669c9219736eb9d64a62f99463b6b1667ca /sources | |
parent | a7e9b253085b1b341d9b910ce8447b18fce4aaa9 (diff) | |
download | scala-45a2a1519be139933decb29558f34486191b7838.tar.gz scala-45a2a1519be139933decb29558f34486191b7838.tar.bz2 scala-45a2a1519be139933decb29558f34486191b7838.zip |
- removed refinements,
- handle scala.Any correctly
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/runtime/types/ClassType.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sources/scala/runtime/types/ClassType.java b/sources/scala/runtime/types/ClassType.java index 31259c9603..eb0b99fb16 100644 --- a/sources/scala/runtime/types/ClassType.java +++ b/sources/scala/runtime/types/ClassType.java @@ -39,7 +39,8 @@ public class ClassType extends Type { } public boolean isSubType(Type that) { - return (that instanceof ClassType + return (that == Type.Any) + || (that instanceof ClassType && isSubClassType((ClassType)that)) || (that instanceof CompoundType && isSubCompoundType((CompoundType)that)); @@ -50,16 +51,13 @@ public class ClassType extends Type { } protected final boolean isSubCompoundType(CompoundType that) { + // TODO? check refinement for (int i = 0; i < that.components.length; ++i) { if (!isSubType(that.components[i])) return false; } - return hasSubRefinements(that.refinements); - } - - protected boolean hasSubRefinements(Refinement[] thatRefinements) { - return thatRefinements.length == 0; + return true; } public boolean isSameAs(Type that) { |