Skip to content

Commit

Permalink
Test case scala#15475
Browse files Browse the repository at this point in the history
This test case first broke when level checking was disabled.

I verified that it compiles OK when Config.checkLevels is set to true.
  • Loading branch information
odersky committed Jun 19, 2022
1 parent f58c158 commit 937714c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/pending/pos/i15475/A.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// A.scala
package x

def hello = {
xtransform {
val a: Seq[Generic[?]] = null
a
.foreach { to =>
to.mthd()
}
}
}

trait Generic[+T] {
def mthd(): Generic[T] = this
}
17 changes: 17 additions & 0 deletions tests/pending/pos/i15475/X.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package x

import scala.quoted.*


transparent inline def xtransform[T](inline expr:T) = ${
X.transform('expr)
}

object X {

def transform[T:Type](x: Expr[T])(using Quotes):Expr[T] = {
import quotes.reflect.*
x
}

}

0 comments on commit 937714c

Please sign in to comment.