Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Apr 12, 2023
1 parent 31aa6df commit 7285496
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/pos-macros/captured-type/Macro_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import scala.quoted.*

inline def foo[U](u: U): U = ${ fooImpl[U]('u) }

def fooImpl[U: Type](u: Expr[U])(using Quotes): Expr[U] = '{
def f[T](x: T): T = ${ identity('{ x: T }) }
f[U]($u)
}
3 changes: 3 additions & 0 deletions tests/pos-macros/captured-type/Test_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test =
foo(1)
foo("abc")

0 comments on commit 7285496

Please sign in to comment.