From 87ae863c3efa7ce41fed81b783855c572d541898 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 10 Apr 2013 15:19:13 +0200 Subject: 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. --- src/dotty/tools/dotc/core/pickling/ClassfileParser.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/pickling/ClassfileParser.scala') 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 -- cgit v1.2.3