diff options
author | Martin Odersky <odersky@gmail.com> | 2007-01-05 18:47:18 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-01-05 18:47:18 +0000 |
commit | 279cdcb49822d5da28e093a8e99a72916dd03f4d (patch) | |
tree | fd78875713fcf9361364b9b60aa131a6137c7d23 /src | |
parent | 96248ae593f34301de81970d6b7ba67d7bf31e04 (diff) | |
download | scala-279cdcb49822d5da28e093a8e99a72916dd03f4d.tar.gz scala-279cdcb49822d5da28e093a8e99a72916dd03f4d.tar.bz2 scala-279cdcb49822d5da28e093a8e99a72916dd03f4d.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 17723218d9..59bcb7efa6 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1957,7 +1957,9 @@ trait Typers requires Analyzer { if (tpt1.tpe.symbol hasFlag ABSTRACT) error(tree.pos, tpt1.tpe.symbol + " is abstract; cannot be instantiated") - else if (!(tpt1.tpe <:< tpt1.tpe.typeOfThis) && !phase.erasedTypes) + else if (tpt1.tpe.symbol.thisSym != tpt1.tpe.symbol && + !(tpt1.tpe <:< tpt1.tpe.typeOfThis) && + !phase.erasedTypes) error(tree.pos, tpt1.tpe.symbol + " cannot be instantiated because it does not conform to its self-type "+ tpt1.tpe.typeOfThis) |