Skip to content

Commit 506e1ea

Browse files
committed
Update tests to new syntax
1 parent 6e91e92 commit 506e1ea

File tree

206 files changed

+661
-675
lines changed

Some content is hidden

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

206 files changed

+661
-675
lines changed

bench/tests/power-macro/PowerMacro.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import scala.quoted.Expr
22

33
object PowerMacro {
44

5-
inline def power(inline n: Long, x: Double) = ~powerCode(n, '(x))
5+
inline def power(inline n: Long, x: Double) = ~powerCode(n, '{x})
66

77
def powerCode(n: Long, x: Expr[Double]): Expr[Double] =
8-
if (n == 0) '(1.0)
9-
else if (n % 2 == 0) '{ val y = ~x * ~x; ~powerCode(n / 2, '(y)) }
8+
if (n == 0) '{1.0}
9+
else if (n % 2 == 0) '{ val y = ~x * ~x; ~powerCode(n / 2, '{y}) }
1010
else '{ ~x * ~powerCode(n - 1, x) }
1111

1212
}

compiler/test-resources/repl/i5551

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ scala> import scala.quoted._
33
scala> def assertImpl(expr: Expr[Boolean]) = '{ if !(~expr) then throw new AssertionError("failed assertion")}
44
def assertImpl(expr: quoted.Expr[Boolean]): quoted.Expr[Unit]
55

6-
scala> inline def assert(expr: => Boolean): Unit = ~ assertImpl('(expr))
6+
scala> inline def assert(expr: => Boolean): Unit = ~ assertImpl('{expr})
77
def assert(expr: => Boolean): Unit
88

99
scala> assert(0 == 0)

tests/disabled/run/i4803d/App_2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object Test {
1111
}
1212

1313
inline def power2(x: Double) = {
14-
inline def power(x: Double, inline n: Long) = ~PowerMacro.powerCode('(x), n)
14+
inline def power(x: Double, inline n: Long) = ~PowerMacro.powerCode('{x}, n)
1515
power(x, 2)
1616
}
1717
}

tests/disabled/run/i4803d/Macro_1.scala

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

33
object PowerMacro {
44
def powerCode(x: Expr[Double], n: Long): Expr[Double] =
5-
if (n == 0) '(1.0)
6-
else if (n % 2 == 0) '{ val y = ~x * ~x; ~powerCode('(y), n / 2) }
7-
else '{ ~x * ~powerCode(x, n - 1) }
5+
if (n == 0) '{1.0}
6+
else if (n % 2 == 0) '{ val y = $x * $x; ~powerCode('{y}, n / 2) }
7+
else '{ $x * ~powerCode(x, n - 1) }
88
}

tests/disabled/run/xml-interpolation-3/XmlQuote_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ object XmlQuote {
99

1010
implicit object SCOps {
1111
inline def xml(this inline ctx: StringContext)(args: => Any*): Xml =
12-
~XmlQuote.impl(ctx, '(args))
12+
${XmlQuote.impl(ctx, '{args})}
1313
}
1414

1515
def impl(receiver: StringContext, args: Expr[Seq[Any]]): Expr[Xml] = {
1616
val string = receiver.parts.mkString("??")
17-
'(new Xml(~string.toExpr, (~args).toList))
17+
'{new Xml(${string.toExpr}, ($args).toList)}
1818
}
1919
}

tests/neg-with-compiler/quote-run-in-macro-1/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.quoted._
33
import scala.quoted.Toolbox.Default._
44

55
object Macros {
6-
inline def foo(i: => Int): Int = ~fooImpl('(i))
6+
inline def foo(i: => Int): Int = ~fooImpl('{i})
77
def fooImpl(i: Expr[Int]): Expr[Int] = {
88
val y: Int = i.run
99
y.toExpr

tests/neg-with-compiler/quote-run-in-macro-2/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.quoted._
33
import scala.quoted.Toolbox.Default._
44

55
object Macros {
6-
inline def foo(i: => Int): Int = ~fooImpl('(i))
6+
inline def foo(i: => Int): Int = ~fooImpl('{i})
77
def fooImpl(i: Expr[Int]): Expr[Int] = {
88
val y: Int = i.run
99
y.toExpr

tests/neg/i4044a.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import scala.quoted._
22

33
class Test {
44

5-
val a = '(1)
5+
val a = '{1}
66
'{
77
a // error
8-
~a
9-
'(~a) // error
10-
'( '(~a) ) // error
8+
$a
9+
'{$a} // error
10+
'{ '{$a} } // error
1111
}
1212

1313
}

tests/neg/i4044b.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ class Test {
44

55
'{
66

7-
val b = '(3)
7+
val b = '{3}
88

99
'{
1010
b // error
1111
~(b)
12-
~('(b)) // error
13-
'( '(~b) ) // error
12+
~('{b}) // error
13+
'{ '{$b} } // error
1414
}
1515

1616
}

tests/neg/i4350.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scala.quoted.Type
22

33
class Foo[T] {
4-
'(null.asInstanceOf[T]) // error
4+
'{null.asInstanceOf[T]} // error
55
}

0 commit comments

Comments
 (0)