Skip to content

Commit c10b945

Browse files
committed
Add negative test cases
1 parent 3467c48 commit c10b945

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
import scala.quoted.*
3+
4+
def test(body: Expr[Any])(using Quotes): Expr[String] =
5+
body match
6+
case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
7+
'{ $b[String]("truthy", "falsy") }
8+
case _ => Expr("not matched")
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Supporting hoas quote pattern with bounded type variable
3+
* is future todo.
4+
*/
5+
6+
import scala.quoted.*
7+
8+
def test(body: Expr[Any])(using Quotes): Expr[String] =
9+
body match
10+
case '{ [A] => (x : A) => $b[A] : A => A } => // error // error
11+
'{ $b[String]("str") } // error
12+
case _ => Expr("not matched")

0 commit comments

Comments
 (0)