Skip to content

Commit 937714c

Browse files
committed
Test case #15475
This test case first broke when level checking was disabled. I verified that it compiles OK when Config.checkLevels is set to true.
1 parent f58c158 commit 937714c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/pending/pos/i15475/A.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// A.scala
2+
package x
3+
4+
def hello = {
5+
xtransform {
6+
val a: Seq[Generic[?]] = null
7+
a
8+
.foreach { to =>
9+
to.mthd()
10+
}
11+
}
12+
}
13+
14+
trait Generic[+T] {
15+
def mthd(): Generic[T] = this
16+
}

tests/pending/pos/i15475/X.scala

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package x
2+
3+
import scala.quoted.*
4+
5+
6+
transparent inline def xtransform[T](inline expr:T) = ${
7+
X.transform('expr)
8+
}
9+
10+
object X {
11+
12+
def transform[T:Type](x: Expr[T])(using Quotes):Expr[T] = {
13+
import quotes.reflect.*
14+
x
15+
}
16+
17+
}

0 commit comments

Comments
 (0)