Skip to content

Commit 61f4b7f

Browse files
committed
Refactor test directories
1 parent 47cfd1e commit 61f4b7f

21 files changed

+59
-57
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class CompilationTests {
3838
compileFilesInDir("tests/pos-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
3939
compileFile("tests/pos-special/utf8encoded.scala", defaultOptions.and("-encoding", "UTF8")),
4040
compileFile("tests/pos-special/utf16encoded.scala", defaultOptions.and("-encoding", "UTF16")),
41-
compileFilesInDir("tests/pos-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
4241
// Run tests for legacy lazy vals
4342
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.posLazyValsAllowlist)),
4443
compileDir("tests/pos-special/java-param-names", defaultOptions.withJavacOnlyOptions("-parameters")),
@@ -118,7 +117,6 @@ class CompilationTests {
118117
compileFilesInDir("tests/neg", defaultOptions),
119118
compileFilesInDir("tests/neg-deep-subtype", allowDeepSubtypes),
120119
compileFilesInDir("tests/neg-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
121-
compileFilesInDir("tests/neg-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
122120
compileFile("tests/neg-custom-args/sourcepath/outer/nested/Test1.scala", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath")),
123121
compileDir("tests/neg-custom-args/sourcepath2/hi", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath2", "-Xfatal-warnings")),
124122
compileList("duplicate source", List(
@@ -139,7 +137,6 @@ class CompilationTests {
139137
@Test def runAll: Unit = {
140138
implicit val testGroup: TestGroup = TestGroup("runAll")
141139
aggregateTests(
142-
compileFilesInDir("tests/run-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
143140
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init")),
144141
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
145142
compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking")),

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

Lines changed: 0 additions & 4 deletions
This file was deleted.

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

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:10:48 -----------------------------------------
2+
10 | case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
3+
| ^
4+
| Type must be fully defined.
5+
| Consider annotating the splice using a type ascription:
6+
| (${b}: XYZ).
7+
-- [E006] Not Found Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:11:10 ------------------------
8+
11 | '{ $b[String]("truthy", "falsy") } // error
9+
| ^
10+
| Not found: b
11+
|
12+
| longer explanation available when compiling with `-explain`
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/*
2-
* Supporting hoas quote pattern with bounded type variable
3-
* is future todo.
4-
*/
1+
/**
2+
* Supporting hoas quote pattern with bounded type variable
3+
* is future todo.
4+
* Refer to: quoted-pattern-with-bounded-type-params.scala
5+
*/
56

67
import scala.quoted.*
78

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
-- Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:10:48 -----------------------------------------
2-
10 | case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
3-
| ^
4-
| Type must be fully defined.
5-
| Consider annotating the splice using a type ascription:
6-
| (${b}: XYZ).
7-
-- [E006] Not Found Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:11:10 ------------------------
8-
11 | '{ $b[String]("truthy", "falsy") } // error
9-
| ^
10-
| Not found: b
11-
|
12-
| longer explanation available when compiling with `-explain`
1+
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-bounded-type-params.scala:10:50 ----------------
2+
10 | case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => ??? // error
3+
| ^
4+
| Implementation restriction: Type arguments to Open pattern are expected to have no bounds

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/**
2-
* Supporting hoas quote pattern with bounded type variable
3-
* is future todo.
4-
* Refer to: neg-custom-args/quoted-pattern-poly/quoted-pattern-with-bounded-type-params.scala
5-
*/
1+
/*
2+
* Supporting hoas quote pattern with bounded type variable
3+
* is future todo.
4+
*/
65

76
import scala.quoted.*
7+
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions
88

99
def test(body: Expr[Any])(using Quotes): Expr[String] =
1010
body match
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:8:31 --------------------------------------------------
2+
8 | case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
3+
| ^
4+
| Type must be fully defined.
5+
| Consider annotating the splice using a type ascription:
6+
| (${b}: XYZ).
7+
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:9:33 --------------------------------------------------
8+
9 | case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
9+
| ^
10+
| Type variables that this argument depends on are not captured in this hoas pattern
11+
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:10:24 -------------------------------------------------
12+
10 | case '{ (a:Int) => $b[Int](a) : String } => ??? // error
13+
| ^
14+
| Type must be fully defined.
15+
| Consider annotating the splice using a type ascription:
16+
| (${b}: XYZ).

tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala renamed to tests/neg-macros/quoted-pattern-with-type-params-regression.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/**
2+
* Refer to: quoted-pattern-with-type-params.scala
3+
*/
14
import scala.quoted.*
25

36
def test(body: Expr[Any])(using Quotes): Expr[String] =
Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:8:31 --------------------------------------------------
2-
8 | case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
3-
| ^
4-
| Type must be fully defined.
5-
| Consider annotating the splice using a type ascription:
6-
| (${b}: XYZ).
7-
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:9:33 --------------------------------------------------
8-
9 | case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
1+
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala:5:32 -------------------------
2+
5 | case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
3+
| ^^^^^
4+
| Implementation restriction: A higher-order pattern must carry value arguments
5+
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala:6:33 -------------------------
6+
6 | case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
97
| ^
108
| Type variables that this argument depends on are not captured in this hoas pattern
11-
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:10:24 -------------------------------------------------
12-
10 | case '{ (a:Int) => $b[Int](a) : String } => ??? // error
13-
| ^
14-
| Type must be fully defined.
15-
| Consider annotating the splice using a type ascription:
16-
| (${b}: XYZ).
9+
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala:7:26 -------------------------
10+
7 | case '{ (a:Int) => $b[Int](a) : String } => ??? // error
11+
| ^^^
12+
| Type arguments of a hoas pattern needs to be defined inside the quoted pattern

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
/**
2-
* Refer to: neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala
3-
*/
41
import scala.quoted.*
2+
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions
53

64
def test(body: Expr[Any])(using Quotes): Expr[String] =
75
body match
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted.*
2+
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions
23

34
def test(body: Expr[Any])(using Quotes): Expr[String] =
45
body match

tests/run-macros/quote-match-poly-function-regression/Macro_1.scala renamed to tests/run-macros/quote-match-poly-function-1/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted.*
2+
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions
23

34
inline def testExpr(inline body: Any) = ${ testExprImpl1('body) }
45
def testExprImpl1(body: Expr[Any])(using Quotes): Expr[String] =
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted.*
2+
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions
23

34
inline def testExpr(inline body: Any) = ${ testExprImpl1('body) }
45
def testExprImpl1(body: Expr[Any])(using Quotes): Expr[String] =

0 commit comments

Comments
 (0)