diff --git a/library/src/scala/tasty/reflect/TreeUtils.scala b/library/src/scala/tasty/reflect/TreeUtils.scala index 5116cc90eed9..7146e5ff1269 100644 --- a/library/src/scala/tasty/reflect/TreeUtils.scala +++ b/library/src/scala/tasty/reflect/TreeUtils.scala @@ -46,6 +46,8 @@ trait TreeUtils foldTree(foldTrees(x, stats), expr) case If(cond, thenp, elsep) => foldTree(foldTree(foldTree(x, cond), thenp), elsep) + case While(cond, body) => + foldTree(foldTree(x, cond), body) case Lambda(meth, tpt) => val a = foldTree(x, meth) tpt.fold(a)(b => foldTree(a, b)) diff --git a/tests/run-macros/tasty-extractors-3/quoted_2.scala b/tests/run-macros/tasty-extractors-3/quoted_2.scala index 1f4d1de11855..3a5676a765fe 100644 --- a/tests/run-macros/tasty-extractors-3/quoted_2.scala +++ b/tests/run-macros/tasty-extractors-3/quoted_2.scala @@ -10,6 +10,7 @@ object Test { def f2[T >: Int <: Int](): T = ??? class Foo { type X } val foo = new Foo { type X = String } + while (true) println() } } }