Skip to content

Commit 28187d9

Browse files
committed
Add tests for #14182
1 parent 584c05b commit 28187d9

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

tests/pos-macros/i14182/Macro_1.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import scala.quoted._
2+
def fooImpl(xs: Expr[(Int, Int)])(using Quotes): Expr[Unit] =
3+
'{ val a: Int = $xs._1; }

tests/pos-macros/i14182/Test_2.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inline def foo(inline xs: (Int, Int)): Unit = ${ fooImpl('xs) }
2+
def fail = foo(1 *: 2 *: EmptyTuple)
3+
def ok = foo((1, 2))

tests/pos/i14182.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inline def foo(inline xs: (Int, Int)): Unit = { val a: Int = xs._1; }
2+
def fail = foo(1 *: 2 *: EmptyTuple)
3+
def ok = foo((1, 2))

tests/pos/i14182a.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inline def foo(xs: (Int, Int)): Unit = { val a: Int = xs._1; }
2+
def fail = foo(1 *: 2 *: EmptyTuple)
3+
def ok = foo((1, 2))

tests/pos/i14182b.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
inline def foo(inline xs: (Int, Int)): xs.type = { val a: Int = xs._1; xs }
2+
def bar =
3+
val tup: 1 *: 2 *: EmptyTuple = ???
4+
val tup2: tup.type = foo(tup)

tests/pos/i14182c.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inline def foo(xs: => (Int, Int)): Unit = { val a: Int = xs._1; }
2+
def bar =
3+
foo(1 *: 2 *: EmptyTuple)

0 commit comments

Comments
 (0)