Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/pos-macros/i15475.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def test =
transform {
val a: Seq[Generic[?]] = ???
a.foreach { to =>
to.mthd()
}
}

transparent inline def transform[T](expr: T): T = ???

trait Generic[+T] {
def mthd(): Generic[T] = ???
}
17 changes: 17 additions & 0 deletions tests/pos-macros/i15475a/Macro_1.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
}

}
15 changes: 15 additions & 0 deletions tests/pos-macros/i15475a/Test_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package x

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

trait Generic[+T] {
def mthd(): Generic[T] = this
}