Skip to content

Commit 031879a

Browse files
authored
Merge pull request #2415 from dotty-staging/fix-erasure
Remove empty tree after erasure to pass -Ycheck:all
2 parents c6a2a3f + 52b45b5 commit 031879a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ object Erasure extends TypeTestsCasts{
600600
val stats1 =
601601
if (takesBridges(ctx.owner)) new Bridges(ctx.owner.asClass).add(stats)
602602
else stats
603-
super.typedStats(stats1, exprOwner)
603+
super.typedStats(stats1, exprOwner).filter(!_.isEmpty)
604604
}
605605

606606
override def adapt(tree: Tree, pt: Type, original: untpd.Tree)(implicit ctx: Context): Tree =

tests/pos/erased-typedef.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
trait Monadless[Monad[_]] {
2+
3+
type M[T] = Monad[T]
4+
5+
def lift[T](body: T): Monad[T] = ???
6+
7+
def unlift[T](m: M[T]): T = ???
8+
}

0 commit comments

Comments
 (0)