summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-05-03 11:09:13 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-05-03 13:35:23 +0200
commit7a5aaa9e23a98d60343cc0c4411b3fc395faa3ab (patch)
tree130f26f5dac9af4498d5f4604745c9209415db02 /src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
parent6300c3033e7b852c6cbef332af6085aac6150a70 (diff)
downloadscala-7a5aaa9e23a98d60343cc0c4411b3fc395faa3ab.tar.gz
scala-7a5aaa9e23a98d60343cc0c4411b3fc395faa3ab.tar.bz2
scala-7a5aaa9e23a98d60343cc0c4411b3fc395faa3ab.zip
SI-5703: normalize refined types more
to improve Array[T] java-interop with T[], normalize Object with Object{} to Object fix #SI-5688 by flattening refined types in parents updated check files to reflect flattening of refined types and updated position for refined types
Diffstat (limited to 'src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
index b51c8baa31..739060d02e 100644
--- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
+++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
@@ -774,8 +774,12 @@ abstract class ClassfileParser {
// make unbounded Array[T] where T is a type variable into Array[T with Object]
// (this is necessary because such arrays have a representation which is incompatible
// with arrays of primitive types.
- if (elemtp.typeSymbol.isAbstractType && !(elemtp <:< definitions.ObjectClass.tpe))
+ // 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 <:< definitions.ObjectClass.tpe)) {
elemtp = intersectionType(List(elemtp, definitions.ObjectClass.tpe))
+ }
definitions.arrayType(elemtp)
case '(' =>