Skip to content

Commit 97cd99b

Browse files
committed
Fix #6765: Add regression test
1 parent e2f4070 commit 97cd99b

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

tests/run-macros/i6765.check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
val x$1: java.lang.String = "One"
3+
scala.Nil.::[java.lang.String](x$1)
4+
}
5+
{
6+
val x$1: java.lang.String = "One"
7+
scala.Nil.::[java.lang.String](x$1)
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import scala.quoted._
2+
import delegate scala.quoted._
3+
4+
delegate for Toolbox = Toolbox.make(getClass.getClassLoader)
5+
6+
inline def crash = ${crashImpl}
7+
8+
def crashImpl given (qctx: QuoteContext) = {
9+
import qctx.tasty._ // Works if commented out
10+
val res = List('{"One"}).toExprOfList // Works if replaced with '{"One" :: Nil}
11+
res.show.toExpr
12+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
object Test {
2+
def main(args: Array[String]): Unit = {
3+
val res = crash // Works if these two lines are commented out at the same time
4+
println(res) // Works if these two lines are commented out at the same time
5+
6+
println(crash)
7+
}
8+
}

0 commit comments

Comments
 (0)