summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-01-24 14:41:00 +0000
committerMartin Odersky <odersky@gmail.com>2008-01-24 14:41:00 +0000
commit67176e0d6ede7e7594417dedc02317c08da8e3ce (patch)
tree57e998fee1327eb71f4afb5e204f9b3b3b0c1662
parent45f7a9228a88db488171b97402cbd6be34347e7b (diff)
downloadscala-67176e0d6ede7e7594417dedc02317c08da8e3ce.tar.gz
scala-67176e0d6ede7e7594417dedc02317c08da8e3ce.tar.bz2
scala-67176e0d6ede7e7594417dedc02317c08da8e3ce.zip
Fixed #404
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala14
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