diff options
author | Martin Odersky <odersky@gmail.com> | 2013-04-10 15:19:13 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-04-10 15:19:13 +0200 |
commit | 87ae863c3efa7ce41fed81b783855c572d541898 (patch) | |
tree | 590151812be9d41257e7c4b5d5f804853be78d31 /src/dotty/tools/dotc/core/pickling/ClassfileParser.scala | |
parent | 1034d4e420c2b0724945486f341c53a07e6a90e0 (diff) | |
download | dotty-87ae863c3efa7ce41fed81b783855c572d541898.tar.gz dotty-87ae863c3efa7ce41fed81b783855c572d541898.tar.bz2 dotty-87ae863c3efa7ce41fed81b783855c572d541898.zip |
Re-organized comparisons of types with classes.
New methods: isClassType, derivesFrom, isArray. Refactored calls to typeSymbol and <:< into these. Made sure to use dealias where needed on remaining typeSymbol calls.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/ClassfileParser.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/ClassfileParser.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala index 801841915..4ba4842e1 100644 --- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala +++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala @@ -284,7 +284,7 @@ class ClassfileParser( // NOTE that the comparison to Object only works for abstract types bounded by classes that are strict subclasses of Object // if the bound is exactly Object, it will have been converted to Any, and the comparison will fail // see also RestrictJavaArraysMap (when compiling java sources directly) - if (elemtp.typeSymbol.isAbstractType && !(elemtp <:< defn.ObjectType)) { + if (elemtp.typeSymbol.isAbstractType && !(elemtp.derivesFrom(defn.ObjectClass))) { elemtp = AndType(elemtp, defn.ObjectType) } @@ -430,7 +430,7 @@ class ClassfileParser( def parseAttributes(sym: Symbol, symtype: Type): Type = { def convertTo(c: Constant, pt: Type): Constant = { - if (pt.typeSymbol == defn.BooleanClass && c.tag == IntTag) + if (pt == defn.BooleanType && c.tag == IntTag) Constant(c.value != 0) else c convertTo pt |