aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-06-11 19:09:06 +0200
committerMartin Odersky <odersky@gmail.com>2015-06-19 12:11:18 +0200
commit8c28293fd52213616ed8ca3a2f600eb1e19debe0 (patch)
treea07d7d0116530ab19e71e5909433df439b57f7a2 /src/dotty/tools/dotc/typer/Typer.scala
parent065a0b4c9cb34b448e070a80e4ad4af9e5ade20a (diff)
downloaddotty-8c28293fd52213616ed8ca3a2f600eb1e19debe0.tar.gz
dotty-8c28293fd52213616ed8ca3a2f600eb1e19debe0.tar.bz2
dotty-8c28293fd52213616ed8ca3a2f600eb1e19debe0.zip
Implement checking for illegal parent trait constructor calls.
A parent trait may not be parameterized (as in T()) if the calling class does not directly implement that trait.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 5f03d19e7..2bdd0d197 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -911,8 +911,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
if (tree.isType) typedType(tree)(superCtx)
else {
val result = typedExpr(tree)(superCtx)
- if ((cls is Trait) && result.tpe.classSymbol.isRealClass && !ctx.isAfterTyper)
- ctx.error(s"trait may not call constructor of ${result.tpe.classSymbol}", tree.pos)
+ checkParentCall(result, cls)
result
}