Skip to content

Commit d7849a5

Browse files
committed
Add transparent inline test
1 parent f7ff617 commit d7849a5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/run/i8577i.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import scala.quoted._
2+
3+
object Macro:
4+
opaque type StrCtx = StringContext
5+
def apply(ctx: StringContext): StrCtx = ctx
6+
def unapply(ctx: StrCtx): Option[StringContext] = Some(ctx)
7+
8+
extension (ctx: StringContext) def mac: Macro.StrCtx = Macro(ctx)
9+
extension (inline ctx: Macro.StrCtx) transparent inline def unapplySeq(inline input: String): Option[Seq[Any]] =
10+
Some(Seq(123))
11+
12+
@main def Test: Unit =
13+
"abc" match
14+
case mac"$x" =>
15+
val y: Int = x
16+
assert(x == 123)

0 commit comments

Comments
 (0)