From 7a5aaa9e23a98d60343cc0c4411b3fc395faa3ab Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 3 May 2012 11:09:13 +0200 Subject: 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 --- src/compiler/scala/tools/nsc/typechecker/Namers.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 45f7d7e618..4e7dac890b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -1347,6 +1347,11 @@ trait Namers extends MethodSynthesis { /** Convert Java generic array type T[] to (T with Object)[] * (this is necessary because such arrays have a representation which is incompatible * with arrays of primitive types.) + * + * @note 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 sigToType */ private object RestrictJavaArraysMap extends TypeMap { def apply(tp: Type): Type = tp match { -- cgit v1.2.3