diff options
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, 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 89c30590c9..9c13c630b1 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3925,6 +3925,10 @@ trait Typers extends Modes with Adaptations with Taggings with PatMatVirtualiser val sym = tp.typeSymbol.initialize if (sym.isAbstractType || sym.hasAbstractFlag) IsAbstractError(tree, sym) + else if (isPrimitiveValueClass(sym)) { + NotAMemberError(tpt, TypeTree(tp), nme.CONSTRUCTOR) + setError(tpt) + } 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 |