Skip to content

Commit 3b8e521

Browse files
authored
Merge pull request #484 from scala/backport-lts-3.3-23353
Backport "Drop invalid assumption from TastyUnpickler" to 3.3 LTS
2 parents 1677c33 + b699e98 commit 3b8e521

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

compiler/src/dotty/tools/dotc/core/tasty/TreeUnpickler.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,6 @@ class TreeUnpickler(reader: TastyReader,
11061106
inline def readImportOrExport(inline mkTree:
11071107
(Tree, List[untpd.ImportSelector]) => Tree)()(using Context): Tree = {
11081108
val start = currentAddr
1109-
assert(sourcePathAt(start).isEmpty)
11101109
readByte()
11111110
readEnd()
11121111
val expr = readTree()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import scala.quoted._
2+
3+
object TestBuilder:
4+
// transparent is needed
5+
transparent inline def apply(inline expr: Unit): Any =
6+
${ TestBuilder.processTests('expr) }
7+
8+
def processTests(using Quotes)(body: Expr[Unit]): Expr[Any] =
9+
import quotes.reflect._
10+
body.asTerm match {
11+
case Inlined(_, _, bindings) =>
12+
'{ ${bindings.asExpr}; () } // can also be List(${bindings})
13+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
object breaks {
2+
TestBuilder:
3+
import List.empty
4+
}

0 commit comments

Comments
 (0)