Skip to content

Commit 575f989

Browse files
committed
Fix CI: avoid flattening of lambdas in reflect printers
1 parent 5292999 commit 575f989

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/src/scala/tasty/reflect/Printers.scala

+4
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,8 @@ trait Printers
976976
def flatBlock(stats: List[Statement], expr: Term): (List[Statement], Term) = {
977977
val flatStats = List.newBuilder[Statement]
978978
def extractFlatStats(stat: Statement): Unit = stat match {
979+
case Lambda(_, _) => // must come before `Block`
980+
flatStats += stat
979981
case Block(stats1, expr1) =>
980982
val it = stats1.iterator
981983
while (it.hasNext)
@@ -990,6 +992,8 @@ trait Printers
990992
case stat => flatStats += stat
991993
}
992994
def extractFlatExpr(term: Term): Term = term match {
995+
case Lambda(_, _) => // must come before `Block`
996+
term
993997
case Block(stats1, expr1) =>
994998
val it = stats1.iterator
995999
while (it.hasNext)

0 commit comments

Comments
 (0)