Skip to content

Commit 6ca1b10

Browse files
committed
Handle super calls in blocks
1 parent fd7d511 commit 6ca1b10

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/src/dotty/tools/dotc/ast/TreeInfo.scala

+1
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ trait TypedTreeInfo extends TreeInfo[Type] { self: Trees.Instance[Type] =>
837837
final def splitAtSuper(constrStats: List[Tree])(implicit ctx: Context): (List[Tree], List[Tree]) =
838838
constrStats.toList match {
839839
case (sc: Apply) :: rest if sc.symbol.isConstructor => (sc :: Nil, rest)
840+
case (block @ Block(_, sc: Apply)) :: rest if sc.symbol.isConstructor => (block :: Nil, rest)
840841
case stats => (Nil, stats)
841842
}
842843

tests/run/i1441.scala

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class FrameworkTest(val cls: Class[_], val format: Int = 1, val expected: String)
2+
3+
class FixtureFrameworkSuite
4+
object FixtureFrameworkSuite extends FrameworkTest(
5+
classOf[FixtureFrameworkSuite],
6+
expected = "test"
7+
)
8+
9+
@main
10+
def Test = FixtureFrameworkSuite

0 commit comments

Comments
 (0)