summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-01-05 18:47:18 +0000
committerMartin Odersky <odersky@gmail.com>2007-01-05 18:47:18 +0000
commit279cdcb49822d5da28e093a8e99a72916dd03f4d (patch)
treefd78875713fcf9361364b9b60aa131a6137c7d23 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent96248ae593f34301de81970d6b7ba67d7bf31e04 (diff)
downloadscala-279cdcb49822d5da28e093a8e99a72916dd03f4d.tar.gz
scala-279cdcb49822d5da28e093a8e99a72916dd03f4d.tar.bz2
scala-279cdcb49822d5da28e093a8e99a72916dd03f4d.zip
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, 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)