File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed
tests/run-custom-args/run-macros-erased Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change
1
+ case erased: [erased case]
Original file line number Diff line number Diff line change
1
+ import scala .quoted .*
2
+
3
+ inline def testExpr (inline body : Any ) = $ { testExprImpl(' body ) }
4
+ def testExprImpl (body : Expr [Any ])(using Quotes ): Expr [String ] =
5
+ body match
6
+ // Erased Types
7
+ case ' { def erasedfn (y : String ) = " placeholder" ; $a(erasedfn): String } =>
8
+ Expr (" This case should not match" )
9
+ case ' { def erasedfn (erased y : String ) = " placeholder" ; $a(erasedfn): String } =>
10
+ ' { $a((erased z : String ) => " [erased case]" ) }
11
+ case _ => Expr (" not matched" )
Original file line number Diff line number Diff line change
1
+ @ main def Test : Unit =
2
+ println(" case erased: " + testExpr { def erasedfn1 (erased x : String ) = " placeholder" ; erasedfn1(" arg1" )})
You can’t perform that action at this time.
0 commit comments