Skip to content

Commit 12ca2fe

Browse files
committed
Handle closures in SelectStatic
Used to fail in backend when reference of closure was to a static method. The test case failing is 2127.scala
1 parent e5c8fa3 commit 12ca2fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class SelectStatic extends MiniPhaseTransform with IdentityDenotTransformer { th
4343
Block(stats, Apply(qual, nm))
4444
case TypeApply(Block(stats, qual), nm) =>
4545
Block(stats, TypeApply(qual, nm))
46+
case Closure(env, Block(stats, qual), tpt) =>
47+
Block(stats, Closure(env, qual, tpt))
4648
case _ => t
4749
}
4850

@@ -53,4 +55,8 @@ class SelectStatic extends MiniPhaseTransform with IdentityDenotTransformer { th
5355
override def transformTypeApply(tree: tpd.TypeApply)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = {
5456
normalize(tree)
5557
}
58+
59+
override def transformClosure(tree: tpd.Closure)(implicit ctx: Context, info: TransformerInfo): tpd.Tree = {
60+
normalize(tree)
61+
}
5662
}

0 commit comments

Comments
 (0)