diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-25 14:33:51 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-11-25 14:33:51 -0800 |
commit | 554f1bbf91084cb501584971f2c90809c819c0a5 (patch) | |
tree | 61bfca8105e1c15d1a1f835af8b41598e770fbc6 /src/compiler | |
parent | 5f21394cd42dbd93e34320e09403cd66bdad3a96 (diff) | |
parent | a5e24768f26bb2d28c7610ff5a184b0c65f56c55 (diff) | |
download | scala-554f1bbf91084cb501584971f2c90809c819c0a5.tar.gz scala-554f1bbf91084cb501584971f2c90809c819c0a5.tar.bz2 scala-554f1bbf91084cb501584971f2c90809c819c0a5.zip |
Merge pull request #3130 from retronym/ticket/7967-2
SI-7967 Account for type aliases in self-type checks
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index 8594309818..355e52ce2b 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1698,15 +1698,16 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper psym addChild context.owner else pending += ParentSealedInheritanceError(parent, psym) + val parentTypeOfThis = parent.tpe.dealias.typeOfThis - if (!(selfType <:< parent.tpe.typeOfThis) && + if (!(selfType <:< parentTypeOfThis) && !phase.erasedTypes && !context.owner.isSynthetic && // don't check synthetic concrete classes for virtuals (part of DEVIRTUALIZE) !selfType.isErroneous && !parent.tpe.isErroneous) { pending += ParentSelfTypeConformanceError(parent, selfType) - if (settings.explaintypes) explainTypes(selfType, parent.tpe.typeOfThis) + if (settings.explaintypes) explainTypes(selfType, parentTypeOfThis) } if (parents exists (p => p != parent && p.tpe.typeSymbol == psym && !psym.isError)) |