aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/ast
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2017-02-13 15:36:57 +0100
committerGitHub <noreply@github.com>2017-02-13 15:36:57 +0100
commitb29783237c03ade1dd19cc564170c7a87d7b8b84 (patch)
tree9aa30b02b5267665bb204a38c4912c3b763f4375 /compiler/src/dotty/tools/dotc/ast
parent07b67a8416c501d7f7b37442f3a294d9f9252895 (diff)
parent36e91d4ed0a293943d66f409f7515953e961067f (diff)
downloaddotty-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/ast')
-rw-r--r--compiler/src/dotty/tools/dotc/ast/tpd.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/ast/tpd.scala b/compiler/src/dotty/tools/dotc/ast/tpd.scala
index 565ec5ce2..ed268fda7 100644
--- a/compiler/src/dotty/tools/dotc/ast/tpd.scala
+++ b/compiler/src/dotty/tools/dotc/ast/tpd.scala
@@ -260,7 +260,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def AnonClass(parents: List[Type], fns: List[TermSymbol], methNames: List[TermName])(implicit ctx: Context): Block = {
val owner = fns.head.owner
val parents1 =
- if (parents.head.classSymbol.is(Trait)) defn.ObjectType :: parents
+ if (parents.head.classSymbol.is(Trait)) parents.head.parents.head :: parents
else parents
val cls = ctx.newNormalizedClassSymbol(owner, tpnme.ANON_FUN, Synthetic, parents1,
coord = fns.map(_.pos).reduceLeft(_ union _))