Skip to content

Commit 4f3b37c

Browse files
committed
Refactor test cases
1 parent 36b820f commit 4f3b37c

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-bounded-type-params.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ import scala.quoted.*
77

88
def test(body: Expr[Any])(using Quotes): Expr[String] =
99
body match
10-
case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
11-
'{ $b[String]("truthy", "falsy") }
10+
case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => ??? // error
1211
case _ => Expr("not matched")

tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import scala.quoted.*
22

33
def test(body: Expr[Any])(using Quotes): Expr[String] =
44
body match
5-
case '{ [A] => (x : A) => $b[A] : (A => A) } => // error
6-
Expr("A higher-order pattern must carry value params")
7-
case '{ [A] => (x : A) => $b(x) : (A => A) } => // error
8-
Expr("`A` should be in type arguments because `x` depends on it")
9-
case '{ (a:Int) => $b[Int](a) : String } => // error
10-
Expr("Type params of a hoas pattern should be introduced inside the quote")
5+
case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
6+
case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
7+
case '{ (a:Int) => $b[Int](a) : String } => ??? // error
118
case _ => Expr("not matched")

tests/neg-macros/quoted-pattern-with-bounded-type-params.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@ import scala.quoted.*
88

99
def test(body: Expr[Any])(using Quotes): Expr[String] =
1010
body match
11-
case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
12-
'{ $b[String]("truthy", "falsy") } // error
11+
case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => ??? // error
1312
case _ => Expr("not matched")

tests/neg-macros/quoted-pattern-with-type-params.scala

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ import scala.quoted.*
55

66
def test(body: Expr[Any])(using Quotes): Expr[String] =
77
body match
8-
case '{ [A] => (x : A) => $b[A] : (A => A) } => // error
9-
Expr("A higher-order pattern must carry value params")
10-
case '{ [A] => (x : A) => $b(x) : (A => A) } => // error
11-
Expr("`A` should be in type arguments because `x` depends on it")
12-
case '{ (a:Int) => $b[Int](a) : String } => // error
13-
Expr("Type params of a hoas pattern should be introduced inside the quote")
8+
case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
9+
case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
10+
case '{ (a:Int) => $b[Int](a) : String } => ??? // error
1411
case _ => Expr("not matched")

0 commit comments

Comments
 (0)