Skip to content

Commit ce45ef6

Browse files
Merge pull request #8553 from dotty-staging/update-inline-params
Update inline parameters
2 parents adc44da + 25f371e commit ce45ef6

File tree

19 files changed

+22
-22
lines changed

19 files changed

+22
-22
lines changed

library/src-non-bootstrapped/dotty/internal/StringContextMacro.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import scala.quoted._
77
object StringContextMacro {
88

99
/** Implementation of scala.StringContext.f used in Dotty */
10-
inline def f(sc: => StringContext)(args: Any*): String =
10+
inline def f(inline sc: StringContext)(args: Any*): String =
1111
scala.compiletime.error("Cannot expand f interpolator while bootstrapping the compiler")
1212

1313
}

tests/neg-macros/i6432/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted.autolift
44

55

66
object Macro {
7-
inline def (sc: => StringContext).foo(args: String*): Unit = ${ impl('sc) }
7+
inline def (inline sc: StringContext).foo(args: String*): Unit = ${ impl('sc) }
88

99
def impl(sc: Expr[StringContext])(using qctx: QuoteContext) : Expr[Unit] = {
1010
import qctx.tasty._

tests/neg-macros/i6432b/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted.autolift
44

55

66
object Macro {
7-
inline def (sc: => StringContext).foo(args: String*): Unit = ${ impl('sc) }
7+
inline def (inline sc: StringContext).foo(args: String*): Unit = ${ impl('sc) }
88

99
def impl(sc: Expr[StringContext])(using qctx: QuoteContext) : Expr[Unit] = {
1010
import qctx.tasty._

tests/neg/i7698.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ def showInterpolatorImpl(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(usin
1111
case '[ Int ] => // error
1212
???
1313

14-
inline def (sc: => StringContext) show (args: Any*): String = ${ showInterpolatorImpl('sc, 'args) }
14+
inline def (inline sc: StringContext) show (args: Any*): String = ${ showInterpolatorImpl('sc, 'args) }

tests/run-macros/i5119/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Macro {
55
class StringContextOps(sc: => StringContext) {
66
inline def ff(args: => Any*): String = ${ Macro.impl('sc, 'args) }
77
}
8-
implicit inline def XmlQuote(sc: => StringContext): StringContextOps = new StringContextOps(sc)
8+
implicit inline def XmlQuote(inline sc: StringContext): StringContextOps = new StringContextOps(sc)
99
def impl(sc: Expr[StringContext], args: Expr[Seq[Any]])(using qctx: QuoteContext) : Expr[String] = {
1010
import qctx.tasty._
1111
(sc.unseal.underlyingArgument.showExtractors + "\n" + args.unseal.underlyingArgument.showExtractors)

tests/run-macros/i6253-b/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.quoted._
33

44
object Macros {
55

6-
inline def (self: => StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
6+
inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
77

88
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
99
self match {

tests/run-macros/i6253/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.quoted._
33

44
object Macros {
55

6-
inline def (self: => StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
6+
inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
77

88
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
99
self match {

tests/run-macros/quote-elide-prefix/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.quoted._
33
object Macro {
44

55
// By name StringContext is used to elide the prefix
6-
inline def (sc: => StringContext) ff (args: => Any*): String = ${ Macro.impl('sc, 'args) }
6+
inline def (inline sc: StringContext) ff (args: => Any*): String = ${ Macro.impl('sc, 'args) }
77

88
def impl(sc: Expr[StringContext], args: Expr[Seq[Any]])(using QuoteContext): Expr[String] = '{ $args.mkString }
99
}

tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted._
44

55
object Macros {
66

7-
inline def (self: => StringContext) xyz(inline args: String*): String = ${impl('self, 'args)}
7+
inline def (inline self: StringContext) xyz(inline args: String*): String = ${impl('self, 'args)}
88

99
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
1010
(self, args) match {

tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted._
44

55
object Macros {
66

7-
inline def (self: => StringContext) S(args: => String*): String = ${impl('self, 'args)}
7+
inline def (inline self: StringContext) S(args: => String*): String = ${impl('self, 'args)}
88

99
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
1010
self match {

tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted._
44

55
object Macros {
66

7-
inline def (self: => StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
7+
inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)}
88

99
private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = {
1010
self match {

tests/run-macros/quote-matcher-symantics-1/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.quoted._
44

55
object Macros {
66

7-
inline def lift[T](sym: Symantics[T])(a: => DSL): T = ${impl[T]('sym, 'a)}
7+
inline def lift[T](sym: Symantics[T])(inline a: DSL): T = ${impl[T]('sym, 'a)}
88

99
private def impl[T: Type](sym: Expr[Symantics[T]], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = {
1010

tests/run-macros/quote-matcher-symantics-2/quoted_1.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import scala.quoted.unsafe._
44

55
object Macros {
66

7-
inline def liftString(a: => DSL): String = ${impl(StringNum, 'a)}
7+
inline def liftString(inline a: DSL): String = ${impl(StringNum, 'a)}
88

9-
inline def liftCompute(a: => DSL): Int = ${impl(ComputeNum, 'a)}
9+
inline def liftCompute(inline a: DSL): Int = ${impl(ComputeNum, 'a)}
1010

11-
inline def liftAST(a: => DSL): ASTNum = ${impl(ASTNum, 'a)}
11+
inline def liftAST(inline a: DSL): ASTNum = ${impl(ASTNum, 'a)}
1212

1313
private def impl[T: Type](sym: Symantics[T], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = {
1414

tests/run-macros/quote-matcher-symantics-3/quoted_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import scala.quoted.unsafe._
55
object Macros {
66

77

8-
inline def lift[R[_]](sym: Symantics { type Repr = R })(a: => Int): R[Int] = ${impl('sym, 'a)}
8+
inline def lift[R[_]](sym: Symantics { type Repr = R })(inline a: Int): R[Int] = ${impl('sym, 'a)}
99

1010

1111
private def impl[R[_]: Type](sym: Expr[Symantics { type Repr[X] = R[X] }], expr: Expr[Int])(using QuoteContext): Expr[R[Int]] = {

tests/run-macros/quote-matching-open/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22
import scala.quoted.unsafe._
33
object Macro {
44

5-
inline def openTest(x: => Any): Any = ${ Macro.impl('x) }
5+
inline def openTest(inline x: Any): Any = ${ Macro.impl('x) }
66

77
def impl(x: Expr[Any])(using QuoteContext): Expr[Any] = {
88
x match {

tests/run-macros/quoted-matching-docs-2/Macro_1.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import scala.quoted._
33

44
def sum(args: Int*): Int = args.sum
55

6-
inline def showOptimize(arg: Int): String = ${ showOptimizeExpr('arg) }
7-
inline def optimize(arg: Int): Int = ${ optimizeExpr('arg) }
6+
inline def showOptimize(inline arg: Int): String = ${ showOptimizeExpr('arg) }
7+
inline def optimize(inline arg: Int): Int = ${ optimizeExpr('arg) }
88

99
private def showOptimizeExpr(body: Expr[Int])(using QuoteContext): Expr[String] =
1010
Expr(optimizeExpr(body).show)

tests/run-macros/quoted-pattern-open-expr/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import scala.quoted._
22

3-
inline def test(e: Int): String = ${testExpr('e)}
3+
inline def test(inline e: Int): String = ${testExpr('e)}
44

55
private def testExpr(e: Expr[Int])(using QuoteContext): Expr[String] = {
66
e match {

tests/run-macros/quoted-pattern-type/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
object Lib {
44

5-
inline def foo[T](arg: => T): T = ${ impl('arg) }
5+
inline def foo[T](inline arg: T): T = ${ impl('arg) }
66

77
private def impl[T: Type](arg: Expr[T])(using QuoteContext): Expr[T] = {
88
arg match {

tests/run-macros/refined-selectable-macro/Macro_1.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ object Macro {
88

99
trait SelectableRecordCompanion[T] {
1010
protected def fromUntypedTuple(elems: (String, Any)*): T
11-
inline def fromTuple[T <: Tuple](s: T) <: Any = ${ fromTupleImpl('s, '{ (x: Array[(String, Any)]) => fromUntypedTuple(x: _*) } ) }
11+
inline def fromTuple[T <: Tuple](inline s: T) <: Any = ${ fromTupleImpl('s, '{ (x: Array[(String, Any)]) => fromUntypedTuple(x: _*) } ) }
1212
}
1313

1414
private def toTupleImpl(s: Expr[Selectable])(using qctx:QuoteContext) : Expr[Tuple] = {

0 commit comments

Comments
 (0)