summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-03-20 07:35:58 +0000
committerMartin Odersky <odersky@gmail.com>2011-03-20 07:35:58 +0000
commitdb7431d20919d43c273b7db24d29106db8eb2453 (patch)
tree3139946efe9c7e9c90bec2f0eac371af4a0848a6 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parenta30ae005c5965fa65d05b16718e50c802d969312 (diff)
downloadscala-db7431d20919d43c273b7db24d29106db8eb2453.tar.gz
scala-db7431d20919d43c273b7db24d29106db8eb2453.tar.bz2
scala-db7431d20919d43c273b7db24d29106db8eb2453.zip
Commented #3928 patch.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index fb8b0058eb..d2d9257989 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -4268,6 +4268,10 @@ trait Typers extends Modes {
val restpe = result.tpe.normalize // normalize to get rid of type aliases for the following check (#1241)
if (!phase.erasedTypes && restpe.isInstanceOf[TypeRef] && !restpe.prefix.isStable && !context.unit.isJava) {
+ // The isJava exception if OK only because the only type constructors scalac gets
+ // to see are those in the signatures. These do not need a unique object as a prefix.
+ // The situation is different for new's and super's, but scalac does not look deep
+ // enough to see those. See #3938
error(tree.pos, restpe.prefix+" is not a legal prefix for a constructor")
}