diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-02-13 15:36:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-13 15:36:57 +0100 |
commit | b29783237c03ade1dd19cc564170c7a87d7b8b84 (patch) | |
tree | 9aa30b02b5267665bb204a38c4912c3b763f4375 /compiler/src/dotty/tools/dotc/typer/Typer.scala | |
parent | 07b67a8416c501d7f7b37442f3a294d9f9252895 (diff) | |
parent | 36e91d4ed0a293943d66f409f7515953e961067f (diff) | |
download | dotty-b29783237c03ade1dd19cc564170c7a87d7b8b84.tar.gz dotty-b29783237c03ade1dd19cc564170c7a87d7b8b84.tar.bz2 dotty-b29783237c03ade1dd19cc564170c7a87d7b8b84.zip |
Merge pull request #1931 from dotty-staging/fix-#1501
Fix #1501 - Check trait inheritance condition
Diffstat (limited to 'compiler/src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 652c89094..ded8993fb 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -1288,6 +1288,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (tree.isType) { val result = typedType(tree)(superCtx) val psym = result.tpe.typeSymbol + checkTraitInheritance(psym, cls, tree.pos) if (psym.is(Trait) && !cls.is(Trait) && !cls.superClass.isSubClass(psym)) maybeCall(result, psym, psym.primaryConstructor.info) else @@ -1295,6 +1296,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit } else { val result = typedExpr(tree)(superCtx) + checkTraitInheritance(result.symbol, cls, tree.pos) checkParentCall(result, cls) result } |