diff options
author | Martin Odersky <odersky@gmail.com> | 2011-10-31 13:29:10 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-10-31 13:29:10 +0000 |
commit | 1f3fe09a786b389adcc1425cfd166bc6c3e361b0 (patch) | |
tree | be678b8a7c7621de2cdffc56750e812e5932fb32 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 2d3fe5733cbc6bcf06892c8ee3cb19f7987f6b6a (diff) | |
download | scala-1f3fe09a786b389adcc1425cfd166bc6c3e361b0.tar.gz scala-1f3fe09a786b389adcc1425cfd166bc6c3e361b0.tar.bz2 scala-1f3fe09a786b389adcc1425cfd166bc6c3e361b0.zip |
Closes #5127. Review by extempore.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 54a3e12ce0..f9c5e843b1 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3271,10 +3271,10 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser { }} val tp = tpt1.tpe - val sym = tp.typeSymbol + val sym = tp.typeSymbol.initialize if (sym.isAbstractType || sym.hasAbstractFlag) error(tree.pos, sym + " is abstract; cannot be instantiated") - else if (!( tp == sym.initialize.thisSym.tpe // when there's no explicit self type -- with (#3612) or without self variable + else if (!( tp == sym.thisSym.tpe // when there's no explicit self type -- with (#3612) or without self variable // sym.thisSym.tpe == tp.typeOfThis (except for objects) || narrowRhs(tp) <:< tp.typeOfThis || phase.erasedTypes |