Skip to content

Commit d7faafa

Browse files
authored
Merge pull request #2900 from dotty-staging/remove-deanonymize
remove deAnonymize
2 parents 4f60767 + 1960ca2 commit d7faafa

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -951,13 +951,6 @@ object Types {
951951
this
952952
}
953953

954-
/** Eliminate anonymous classes */
955-
final def deAnonymize(implicit ctx: Context): Type = this match {
956-
case tp:TypeRef if tp.symbol.isAnonymousClass =>
957-
tp.symbol.asClass.typeRef.asSeenFrom(tp.prefix, tp.symbol.owner)
958-
case tp => tp
959-
}
960-
961954
private def dealias(keepAnnots: Boolean)(implicit ctx: Context): Type = this match {
962955
case tp: TypeRef =>
963956
if (tp.symbol.isClass) tp

compiler/src/dotty/tools/dotc/transform/PatternMatcherOld.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ class PatternMatcherOld extends MiniPhaseTransform with DenotTransformer {
12021202
def translateMatch(match_ : Match): Tree = {
12031203
val Match(sel, cases) = match_
12041204

1205-
val selectorTp = sel.tpe.widen.deAnonymize/*withoutAnnotations*/
1205+
val selectorTp = sel.tpe.widen/*withoutAnnotations*/
12061206

12071207
val selectorSym = freshSym(sel.pos, selectorTp, PatMatSelectorName)
12081208

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
704704
}
705705

706706
val Match(sel, cases) = tree
707-
val res = isCheckable(sel.tpe.widen.deAnonymize.dealiasKeepAnnots)
707+
val res = isCheckable(sel.tpe.widen.dealiasKeepAnnots)
708708
debug.println(s"checkable: ${sel.show} = $res")
709709
res
710710
}
@@ -770,7 +770,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
770770

771771
def checkExhaustivity(_match: Match): Unit = {
772772
val Match(sel, cases) = _match
773-
val selTyp = sel.tpe.widen.deAnonymize.dealias
773+
val selTyp = sel.tpe.widen.dealias
774774

775775

776776
val patternSpace = cases.map({ x =>
@@ -787,7 +787,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
787787
def checkRedundancy(_match: Match): Unit = {
788788
val Match(sel, cases) = _match
789789
// ignore selector type for now
790-
// val selTyp = sel.tpe.widen.deAnonymize.dealias
790+
// val selTyp = sel.tpe.widen.dealias
791791

792792
if (cases.length == 1) return
793793

0 commit comments

Comments
 (0)