Skip to content

Commit 5da12b7

Browse files
Move all macro tests to macro test folders (#17990)
We should only execute macro tests on the bootstrap compiler. Also, remove`scala.quoted` imports in tests that do not use it, such as `inline` tests.
2 parents db4befb + e6e1401 commit 5da12b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+9
-42
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/neg/i14772.check renamed to tests/neg-macros/i14772.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-- [E044] Cyclic Error: tests/neg/i14772.scala:7:7 ---------------------------------------------------------------------
1+
-- [E044] Cyclic Error: tests/neg-macros/i14772.scala:7:7 --------------------------------------------------------------
22
7 | foo(a) // error
33
| ^
44
| Overloaded or recursive method impl needs return type
File renamed without changes.

tests/neg/i15009a.check renamed to tests/neg-macros/i15009a.check

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
-- Error: tests/neg/i15009a.scala:4:9 ----------------------------------------------------------------------------------
1+
-- Error: tests/neg-macros/i15009a.scala:4:9 ---------------------------------------------------------------------------
22
4 | '[List[${Type.of[Int]}]] // error
33
| ^^^^^^^^^^^^^^^
44
| Type splicing with `$` in quotes not supported anymore
55
|
66
| Hint: To use a given Type[T] in a quote just write T directly
7-
-- Error: tests/neg/i15009a.scala:7:16 ---------------------------------------------------------------------------------
7+
-- Error: tests/neg-macros/i15009a.scala:7:16 --------------------------------------------------------------------------
88
7 | case '[List[$a]] => // error
99
| ^^
1010
| Type splicing with `$` in quotes not supported anymore
1111
|
1212
| Hint: Use lower cased variable name without the `$` instead
13-
-- Error: tests/neg/i15009a.scala:10:16 --------------------------------------------------------------------------------
13+
-- Error: tests/neg-macros/i15009a.scala:10:16 -------------------------------------------------------------------------
1414
10 | '{ List.empty[$int] } // error
1515
| ^^^^
1616
| Type splicing with `$` in quotes not supported anymore
1717
|
1818
| Hint: To use a given Type[T] in a quote just write T directly
19-
-- Error: tests/neg/i15009a.scala:11:9 ---------------------------------------------------------------------------------
19+
-- Error: tests/neg-macros/i15009a.scala:11:9 --------------------------------------------------------------------------
2020
11 | val t: ${int} = ??? // error
2121
| ^^^^^^
2222
| Type splicing with `$` in quotes not supported anymore
2323
|
2424
| Hint: To use a given Type[T] in a quote just write T directly
25-
-- Error: tests/neg/i15009a.scala:3:2 ----------------------------------------------------------------------------------
25+
-- Error: tests/neg-macros/i15009a.scala:3:2 ---------------------------------------------------------------------------
2626
3 | '[Int] // error
2727
| ^^^^^^
2828
| Quoted types `'[..]` can only be used in patterns.
2929
|
3030
| Hint: To get a scala.quoted.Type[T] use scala.quoted.Type.of[T] instead.
31-
-- [E006] Not Found Error: tests/neg/i15009a.scala:12:2 ----------------------------------------------------------------
31+
-- [E006] Not Found Error: tests/neg-macros/i15009a.scala:12:2 ---------------------------------------------------------
3232
12 | $int // error: Not found: $int
3333
| ^^^^
3434
| Not found: $int
File renamed without changes.
File renamed without changes.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
-- [E032] Syntax Error: tests/neg/splice-pat.scala:12:16 ---------------------------------------------------------------
1+
-- [E032] Syntax Error: tests/neg-macros/splice-pat.scala:12:16 --------------------------------------------------------
22
12 | case '{ foo(${ // error: pattern expected
33
| ^
44
| pattern expected
55
|
66
| longer explanation available when compiling with `-explain`
7-
-- [E040] Syntax Error: tests/neg/splice-pat.scala:15:5 ----------------------------------------------------------------
7+
-- [E040] Syntax Error: tests/neg-macros/splice-pat.scala:15:5 ---------------------------------------------------------
88
15 | })} => ??? // error
99
| ^
1010
| '=>' expected, but ')' found
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/pos/i10107c.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
inline def isTrue: Boolean = true
42

53
inline def oneOf(): String = {

tests/pos/i11184a.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
inline def isTrue: Boolean = true
42
inline def oneOf: String = inline if isTrue then "foo" else "bar"
53
def test1 = oneOf

tests/pos/i11184b.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
inline def isTrue(): Boolean = true
42
inline def oneOf: String = inline if isTrue() then "foo" else "bar"
53
def test1 = oneOf

tests/pos/i11184c.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Foo:
42
inline def isTrue: Boolean = true
53
inline def oneOf: String = inline if Foo.isTrue then "foo" else "bar"

tests/pos/i11184d.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
inline def isTrue: Boolean = true
42
transparent inline def oneOf: Any = inline if isTrue then isTrue else "bar"
53
def test1 = oneOf

tests/pos/i12958.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted.*
2-
31
package mylib:
42
object Export:
53
transparent inline def exported: Any = 1

tests/run/i12052/MirrorType.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import scala.quoted._
21
import scala.deriving._
32
import scala.compiletime.{erasedValue, constValue, summonFrom, summonInline}
43

tests/run/i8577a.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577b.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577c.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577d.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577e.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577f.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577g.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577h.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/i8577i.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Macro:
42
opaque type StrCtx = StringContext
53
def apply(ctx: StringContext): StrCtx = ctx

tests/run/whitebox-inline.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import scala.quoted._
2-
31
object Test {
42
def main(args: Array[String]): Unit = {
53
val a: Int = blackbox

0 commit comments

Comments
 (0)