diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala index 766f6019faf9..a7b02a287f6d 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala @@ -1190,7 +1190,6 @@ class TreeUnpickler(reader: TastyReader, inline def readImportOrExport(inline mkTree: (Tree, List[untpd.ImportSelector]) => Tree)()(using Context): Tree = { val start = currentAddr - assert(sourcePathAt(start).isEmpty) readByte() readEnd() val expr = readTree() diff --git a/scaladoc-testcases/src/tests/22265/macro.scala b/scaladoc-testcases/src/tests/22265/macro.scala new file mode 100644 index 000000000000..a2b9f118ceb5 --- /dev/null +++ b/scaladoc-testcases/src/tests/22265/macro.scala @@ -0,0 +1,13 @@ +import scala.quoted._ + +object TestBuilder: + // transparent is needed + transparent inline def apply(inline expr: Unit): Any = + ${ TestBuilder.processTests('expr) } + + def processTests(using Quotes)(body: Expr[Unit]): Expr[Any] = + import quotes.reflect._ + body.asTerm match { + case Inlined(_, _, bindings) => + '{ ${bindings.asExpr}; () } // can also be List(${bindings}) + } diff --git a/scaladoc-testcases/src/tests/22265/test.scala b/scaladoc-testcases/src/tests/22265/test.scala new file mode 100644 index 000000000000..7642047a175b --- /dev/null +++ b/scaladoc-testcases/src/tests/22265/test.scala @@ -0,0 +1,4 @@ +object breaks { + TestBuilder: + import List.empty +}