File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ def test =
2+ transform {
3+ val a : Seq [Generic [? ]] = ???
4+ a.foreach { to =>
5+ to.mthd()
6+ }
7+ }
8+
9+ transparent inline def transform [T ](expr : T ): T = ???
10+
11+ trait Generic [+ T ] {
12+ def mthd (): Generic [T ] = ???
13+ }
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 1+ package x
2+
3+ def hello = {
4+ xtransform {
5+ val a : Seq [Generic [? ]] = null
6+ a
7+ .foreach { to =>
8+ to.mthd()
9+ }
10+ }
11+ }
12+
13+ trait Generic [+ T ] {
14+ def mthd (): Generic [T ] = this
15+ }
You can’t perform that action at this time.
0 commit comments