Skip to content

Commit 2dc873a

Browse files
committed
address counter-example of two unrelated traits
1 parent 60ba94b commit 2dc873a

File tree

8 files changed

+212
-151
lines changed

8 files changed

+212
-151
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ object Types {
811811
}
812812

813813
/** Eliminate anonymous classes */
814-
final def elimAnonymousClass(implicit ctx: Context): Type = this match {
814+
final def deAnonymize(implicit ctx: Context): Type = this match {
815815
case tp:TypeRef if tp.symbol.isAnonymousClass =>
816816
tp.symbol.asClass.typeRef.asSeenFrom(tp.prefix, tp.symbol.owner)
817817
case tp => tp

src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
13051305
def translateMatch(match_ : Match): Tree = {
13061306
val Match(sel, cases) = match_
13071307

1308-
val selectorTp = sel.tpe.widen.elimAnonymousClass/*withoutAnnotations*/
1308+
val selectorTp = sel.tpe.widen.deAnonymize/*withoutAnnotations*/
13091309

13101310
val selectorSym = freshSym(sel.pos, selectorTp, "selector")
13111311

0 commit comments

Comments
 (0)