diff options
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Infer.scala | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala index 67c302156a..1e6bc6360a 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala @@ -337,6 +337,18 @@ trait Infer { } accessError("") } else { + // Modify symbol's type so that raw types C + // are converted to existentials C[T] forSome { type T }. + // We can't do this on class loading because it would result + // in infinite cycles. + if (sym1.isTerm) { + if (sym1 hasFlag JAVA) + sym1.setInfo(rawToExistential(sym1.info)) + else if (sym1 hasFlag OVERLOADED) + for (sym2 <- sym1.alternatives) + if (sym2 hasFlag JAVA) + sym2.setInfo(rawToExistential(sym2.info)) + } //Console.println("check acc " + sym1 + ":" + sym1.tpe + " from " + pre);//DEBUG var owntype = try{ pre.memberType(sym1) @@ -350,8 +362,6 @@ trait Infer { else " contains a "+ex.msg)) ErrorType } - if (sym1.isTerm && (sym1 hasFlag JAVA)) - owntype = rawToExistential(owntype) if (pre.isInstanceOf[SuperType]) owntype = owntype.substSuper(pre, site.symbol.thisType) tree setSymbol sym1 setType owntype |