diff --git a/library/src-non-bootstrapped/dotty/internal/StringContextMacro.scala b/library/src-non-bootstrapped/dotty/internal/StringContextMacro.scala index d72c594dda09..b3b7c443c332 100644 --- a/library/src-non-bootstrapped/dotty/internal/StringContextMacro.scala +++ b/library/src-non-bootstrapped/dotty/internal/StringContextMacro.scala @@ -7,7 +7,7 @@ import scala.quoted._ object StringContextMacro { /** Implementation of scala.StringContext.f used in Dotty */ - inline def f(sc: => StringContext)(args: Any*): String = + inline def f(inline sc: StringContext)(args: Any*): String = scala.compiletime.error("Cannot expand f interpolator while bootstrapping the compiler") } diff --git a/tests/neg-macros/i6432/Macro_1.scala b/tests/neg-macros/i6432/Macro_1.scala index 7c9b63deb114..32710d446871 100644 --- a/tests/neg-macros/i6432/Macro_1.scala +++ b/tests/neg-macros/i6432/Macro_1.scala @@ -4,7 +4,7 @@ import scala.quoted.autolift.{given _} object Macro { - inline def (sc: => StringContext).foo(args: String*): Unit = ${ impl('sc) } + inline def (inline sc: StringContext).foo(args: String*): Unit = ${ impl('sc) } def impl(sc: Expr[StringContext])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.tasty._ diff --git a/tests/neg-macros/i6432b/Macro_1.scala b/tests/neg-macros/i6432b/Macro_1.scala index 7c9b63deb114..32710d446871 100644 --- a/tests/neg-macros/i6432b/Macro_1.scala +++ b/tests/neg-macros/i6432b/Macro_1.scala @@ -4,7 +4,7 @@ import scala.quoted.autolift.{given _} object Macro { - inline def (sc: => StringContext).foo(args: String*): Unit = ${ impl('sc) } + inline def (inline sc: StringContext).foo(args: String*): Unit = ${ impl('sc) } def impl(sc: Expr[StringContext])(using qctx: QuoteContext) : Expr[Unit] = { import qctx.tasty._ diff --git a/tests/neg/i7698.scala b/tests/neg/i7698.scala index a71b53a6267e..f171b2a0b84f 100644 --- a/tests/neg/i7698.scala +++ b/tests/neg/i7698.scala @@ -11,4 +11,4 @@ def showInterpolatorImpl(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(usin case '[ Int ] => // error ??? -inline def (sc: => StringContext) show (args: Any*): String = ${ showInterpolatorImpl('sc, 'args) } +inline def (inline sc: StringContext) show (args: Any*): String = ${ showInterpolatorImpl('sc, 'args) } diff --git a/tests/run-macros/i5119/Macro_1.scala b/tests/run-macros/i5119/Macro_1.scala index ac8aad2144d8..66ce27787b26 100644 --- a/tests/run-macros/i5119/Macro_1.scala +++ b/tests/run-macros/i5119/Macro_1.scala @@ -5,7 +5,7 @@ object Macro { class StringContextOps(sc: => StringContext) { inline def ff(args: => Any*): String = ${ Macro.impl('sc, 'args) } } - implicit inline def XmlQuote(sc: => StringContext): StringContextOps = new StringContextOps(sc) + implicit inline def XmlQuote(inline sc: StringContext): StringContextOps = new StringContextOps(sc) def impl(sc: Expr[StringContext], args: Expr[Seq[Any]])(using qctx: QuoteContext) : Expr[String] = { import qctx.tasty._ (sc.unseal.underlyingArgument.showExtractors + "\n" + args.unseal.underlyingArgument.showExtractors) diff --git a/tests/run-macros/i6253-b/quoted_1.scala b/tests/run-macros/i6253-b/quoted_1.scala index cadc8730d46c..593e7da59ae4 100644 --- a/tests/run-macros/i6253-b/quoted_1.scala +++ b/tests/run-macros/i6253-b/quoted_1.scala @@ -3,7 +3,7 @@ import scala.quoted._ object Macros { - inline def (self: => StringContext) xyz(args: => String*): String = ${impl('self, 'args)} + inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)} private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = { self match { diff --git a/tests/run-macros/i6253/quoted_1.scala b/tests/run-macros/i6253/quoted_1.scala index 4c7530698588..596db02e2fbc 100644 --- a/tests/run-macros/i6253/quoted_1.scala +++ b/tests/run-macros/i6253/quoted_1.scala @@ -3,7 +3,7 @@ import scala.quoted._ object Macros { - inline def (self: => StringContext) xyz(args: => String*): String = ${impl('self, 'args)} + inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)} private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = { self match { diff --git a/tests/run-macros/quote-elide-prefix/quoted_1.scala b/tests/run-macros/quote-elide-prefix/quoted_1.scala index c47f3583fc56..c7f86bccd281 100644 --- a/tests/run-macros/quote-elide-prefix/quoted_1.scala +++ b/tests/run-macros/quote-elide-prefix/quoted_1.scala @@ -3,7 +3,7 @@ import scala.quoted._ object Macro { // By name StringContext is used to elide the prefix - inline def (sc: => StringContext) ff (args: => Any*): String = ${ Macro.impl('sc, 'args) } + inline def (inline sc: StringContext) ff (args: => Any*): String = ${ Macro.impl('sc, 'args) } def impl(sc: Expr[StringContext], args: Expr[Seq[Any]])(using QuoteContext): Expr[String] = '{ $args.mkString } } diff --git a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala index 887f2c25605e..a6ff0769dc4e 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-2/quoted_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ object Macros { - inline def (self: => StringContext) xyz(inline args: String*): String = ${impl('self, 'args)} + inline def (inline self: StringContext) xyz(inline args: String*): String = ${impl('self, 'args)} private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = { (self, args) match { diff --git a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala index 079cdebc51ab..8a0c5d182bc1 100644 --- a/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator-3/quoted_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ object Macros { - inline def (self: => StringContext) S(args: => String*): String = ${impl('self, 'args)} + inline def (inline self: StringContext) S(args: => String*): String = ${impl('self, 'args)} private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = { self match { diff --git a/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala b/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala index 08950f89e090..128dd17a4679 100644 --- a/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ object Macros { - inline def (self: => StringContext) xyz(args: => String*): String = ${impl('self, 'args)} + inline def (inline self: StringContext) xyz(args: => String*): String = ${impl('self, 'args)} private def impl(self: Expr[StringContext], args: Expr[Seq[String]])(using QuoteContext): Expr[String] = { self match { diff --git a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala index edf9809afcd3..4bc796909386 100644 --- a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala @@ -4,7 +4,7 @@ import scala.quoted._ object Macros { - inline def lift[T](sym: Symantics[T])(a: => DSL): T = ${impl[T]('sym, 'a)} + inline def lift[T](sym: Symantics[T])(inline a: DSL): T = ${impl[T]('sym, 'a)} private def impl[T: Type](sym: Expr[Symantics[T]], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = { diff --git a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala index b58deac142a9..f23247232763 100644 --- a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala @@ -4,11 +4,11 @@ import scala.quoted.unsafe._ object Macros { - inline def liftString(a: => DSL): String = ${impl(StringNum, 'a)} + inline def liftString(inline a: DSL): String = ${impl(StringNum, 'a)} - inline def liftCompute(a: => DSL): Int = ${impl(ComputeNum, 'a)} + inline def liftCompute(inline a: DSL): Int = ${impl(ComputeNum, 'a)} - inline def liftAST(a: => DSL): ASTNum = ${impl(ASTNum, 'a)} + inline def liftAST(inline a: DSL): ASTNum = ${impl(ASTNum, 'a)} private def impl[T: Type](sym: Symantics[T], a: Expr[DSL])(using qctx: QuoteContext): Expr[T] = { diff --git a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala index acc7d5829d61..45b1b16f4642 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala @@ -5,7 +5,7 @@ import scala.quoted.unsafe._ object Macros { - inline def lift[R[_]](sym: Symantics { type Repr = R })(a: => Int): R[Int] = ${impl('sym, 'a)} + inline def lift[R[_]](sym: Symantics { type Repr = R })(inline a: Int): R[Int] = ${impl('sym, 'a)} private def impl[R[_]: Type](sym: Expr[Symantics { type Repr[X] = R[X] }], expr: Expr[Int])(using QuoteContext): Expr[R[Int]] = { diff --git a/tests/run-macros/quote-matching-open/Macro_1.scala b/tests/run-macros/quote-matching-open/Macro_1.scala index 755c92e3e634..c54809207ea1 100644 --- a/tests/run-macros/quote-matching-open/Macro_1.scala +++ b/tests/run-macros/quote-matching-open/Macro_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ import scala.quoted.unsafe._ object Macro { - inline def openTest(x: => Any): Any = ${ Macro.impl('x) } + inline def openTest(inline x: Any): Any = ${ Macro.impl('x) } def impl(x: Expr[Any])(using QuoteContext): Expr[Any] = { x match { diff --git a/tests/run-macros/quoted-matching-docs-2/Macro_1.scala b/tests/run-macros/quoted-matching-docs-2/Macro_1.scala index 412c74a547c5..0a959892f53d 100644 --- a/tests/run-macros/quoted-matching-docs-2/Macro_1.scala +++ b/tests/run-macros/quoted-matching-docs-2/Macro_1.scala @@ -3,8 +3,8 @@ import scala.quoted._ def sum(args: Int*): Int = args.sum -inline def showOptimize(arg: Int): String = ${ showOptimizeExpr('arg) } -inline def optimize(arg: Int): Int = ${ optimizeExpr('arg) } +inline def showOptimize(inline arg: Int): String = ${ showOptimizeExpr('arg) } +inline def optimize(inline arg: Int): Int = ${ optimizeExpr('arg) } private def showOptimizeExpr(body: Expr[Int])(using QuoteContext): Expr[String] = Expr(optimizeExpr(body).show) diff --git a/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala b/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala index c6b05434c9a3..8f3f3b54331f 100644 --- a/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-open-expr/Macro_1.scala @@ -1,6 +1,6 @@ import scala.quoted._ -inline def test(e: Int): String = ${testExpr('e)} +inline def test(inline e: Int): String = ${testExpr('e)} private def testExpr(e: Expr[Int])(using QuoteContext): Expr[String] = { e match { diff --git a/tests/run-macros/quoted-pattern-type/Macro_1.scala b/tests/run-macros/quoted-pattern-type/Macro_1.scala index 11aa24e866d3..7fa9cf6b587f 100644 --- a/tests/run-macros/quoted-pattern-type/Macro_1.scala +++ b/tests/run-macros/quoted-pattern-type/Macro_1.scala @@ -2,7 +2,7 @@ import scala.quoted._ object Lib { - inline def foo[T](arg: => T): T = ${ impl('arg) } + inline def foo[T](inline arg: T): T = ${ impl('arg) } private def impl[T: Type](arg: Expr[T])(using QuoteContext): Expr[T] = { arg match { diff --git a/tests/run-macros/refined-selectable-macro/Macro_1.scala b/tests/run-macros/refined-selectable-macro/Macro_1.scala index 42454e9968b3..af5a11e3bf57 100644 --- a/tests/run-macros/refined-selectable-macro/Macro_1.scala +++ b/tests/run-macros/refined-selectable-macro/Macro_1.scala @@ -8,7 +8,7 @@ object Macro { trait SelectableRecordCompanion[T] { protected def fromUntypedTuple(elems: (String, Any)*): T - inline def fromTuple[T <: Tuple](s: T) <: Any = ${ fromTupleImpl('s, '{ (x: Array[(String, Any)]) => fromUntypedTuple(x: _*) } ) } + inline def fromTuple[T <: Tuple](inline s: T) <: Any = ${ fromTupleImpl('s, '{ (x: Array[(String, Any)]) => fromUntypedTuple(x: _*) } ) } } private def toTupleImpl(s: Expr[Selectable])(using qctx:QuoteContext) : Expr[Tuple] = {