Skip to content

Commit bfb88cc

Browse files
committed
Go back to (given ... parameters and arguments
This reverts commit 04095bc. # Conflicts: # compiler/src/dotty/tools/dotc/parsing/Parsers.scala # compiler/src/dotty/tools/dotc/parsing/Tokens.scala # docs/docs/internals/syntax.md # tests/neg-macros/delegate-match-1/Macro_1.scala # tests/neg-macros/delegate-match-2/Macro_1.scala # tests/neg-macros/delegate-match-3/Macro_1.scala # tests/neg-macros/i6432/Macro_1.scala # tests/neg-macros/i6432b/Macro_1.scala # tests/neg-macros/i6976/Macro_1.scala # tests/neg-macros/inline-case-objects/Macro_1.scala # tests/neg-macros/inline-macro-staged-interpreter/Macro_1.scala # tests/neg-macros/inline-option/Macro_1.scala # tests/neg-macros/inline-tuples-1/Macro_1.scala # tests/neg-macros/macros-in-same-project-6/Foo.scala # tests/neg-macros/quote-error-2/Macro_1.scala # tests/neg-macros/quote-error/Macro_1.scala # tests/neg-macros/quote-exception/Macro_1.scala # tests/neg-macros/quote-whitebox/Macro_1.scala # tests/neg-macros/reflect-inline/assert_1.scala # tests/neg-macros/tasty-macro-assert-1/quoted_1.scala # tests/neg-macros/tasty-macro-assert-2/quoted_1.scala # tests/neg-macros/tasty-macro-error/quoted_1.scala # tests/neg-macros/tasty-macro-positions/quoted_1.scala # tests/neg-macros/tasty-string-interpolator-position-a/Macro_1.scala # tests/neg-macros/tasty-string-interpolator-position-b/Macro_1.scala # tests/neg/given-eta.scala # tests/neg/i7919.scala # tests/neg/implicit-params.scala # tests/pending/run/tasty-comments/quoted_1.scala # tests/pos-custom-args/erased/i7868.scala # tests/pos-macros/i6171/Macro_1.scala # tests/pos-macros/i6535/Macro_1.scala # tests/pos-macros/i6803b/Macro_1.scala # tests/pos-macros/i7011/Macros_1.scala # tests/pos-macros/quote-nested-object/Macro_1.scala # tests/pos-macros/quote-whitebox-2/Macro_1.scala # tests/pos-macros/tasty-constant-type/Macro_1.scala # tests/pos-macros/treemap-unapply/Macro.scala # tests/pos/i7204.scala # tests/pos/i7532.scala # tests/run-custom-args/Yretain-trees/tasty-definitions-2/Macro_1.scala # tests/run-custom-args/Yretain-trees/tasty-definitions-3/Macro_1.scala # tests/run-custom-args/Yretain-trees/tasty-extractors-owners/quoted_1.scala # tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala # tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala # tests/run-custom-args/run-macros-erased/reflect-isFunctionType/macro_1.scala # tests/run-macros/f-interpolation-1/FQuote_1.scala # tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala # tests/run-macros/i4735/Macro_1.scala # tests/run-macros/i4803/Macro_1.scala # tests/run-macros/i4803b/Macro_1.scala # tests/run-macros/i4803c/Macro_1.scala # tests/run-macros/i5119/Macro_1.scala # tests/run-macros/i5119b/Macro_1.scala # tests/run-macros/i5188a/Macro_1.scala # tests/run-macros/i5533/Macro_1.scala # tests/run-macros/i5533b/Macro_1.scala # tests/run-macros/i5536/Macro_1.scala # tests/run-macros/i5629/Macro_1.scala # tests/run-macros/i5715/Macro_1.scala # tests/run-macros/i5941/macro_1.scala # tests/run-macros/i6171/Macro_1.scala # tests/run-macros/i6270/Macro_1.scala # tests/run-macros/i6518/Macro_1.scala # tests/run-macros/i6679/Macro_1.scala # tests/run-macros/i6765-c/Macro_1.scala # tests/run-macros/i6765/Macro_1.scala # tests/run-macros/i6988/FirstArg_1.scala # tests/run-macros/i7898/Macro_1.scala # tests/run-macros/i7964/Macro_1.scala # tests/run-macros/inferred-repeated-result/test_1.scala # tests/run-macros/inline-case-objects/Macro_1.scala # tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala # tests/run-macros/inline-option/Macro_1.scala # tests/run-macros/inline-tuples-1/Macro_1.scala # tests/run-macros/inline-tuples-2/Macro_1.scala # tests/run-macros/inline-varargs-1/Macro_1.scala # tests/run-macros/quote-and-splice/Macros_1.scala # tests/run-macros/quote-inline-function/quoted_1.scala # tests/run-macros/quote-matcher-power/Macro_1.scala # tests/run-macros/quote-matcher-runtime/quoted_1.scala # tests/run-macros/quote-simple-macro/quoted_1.scala # tests/run-macros/quote-toExprOfTuple/Macro_1.scala # tests/run-macros/quote-type-matcher/quoted_1.scala # tests/run-macros/quote-whitebox/Macro_1.scala # tests/run-macros/quoted-expr-block/quoted_1.scala # tests/run-macros/quoted-matching-docs/Macro_1.scala # tests/run-macros/refined-selectable-macro/Macro_1.scala # tests/run-macros/reflect-dsl/assert_1.scala # tests/run-macros/reflect-inline/assert_1.scala # tests/run-macros/reflect-lambda/assert_1.scala # tests/run-macros/reflect-pos-fun/assert_1.scala # tests/run-macros/reflect-select-constructor/assert_1.scala # tests/run-macros/reflect-select-copy-2/assert_1.scala # tests/run-macros/reflect-select-copy/assert_1.scala # tests/run-macros/reflect-select-symbol-constructor/assert_1.scala # tests/run-macros/reflect-select-value-class/assert_1.scala # tests/run-macros/reflect-typeChecks/assert_1.scala # tests/run-macros/requiredSymbols/Macro_1.scala # tests/run-macros/tasty-argument-tree-1/quoted_1.scala # tests/run-macros/tasty-custom-show/quoted_1.scala # tests/run-macros/tasty-dealias/quoted_1.scala # tests/run-macros/tasty-definitions-1/quoted_1.scala # tests/run-macros/tasty-eval/quoted_1.scala # tests/run-macros/tasty-extractors-1/quoted_1.scala # tests/run-macros/tasty-extractors-2/quoted_1.scala # tests/run-macros/tasty-extractors-3/quoted_1.scala # tests/run-macros/tasty-extractors-types/quoted_1.scala # tests/run-macros/tasty-getfile/Macro_1.scala # tests/run-macros/tasty-interpolation-1/Macro.scala # tests/run-macros/tasty-linenumber-2/quoted_1.scala # tests/run-macros/tasty-linenumber/quoted_1.scala # tests/run-macros/tasty-location/quoted_1.scala # tests/run-macros/tasty-macro-assert/quoted_1.scala # tests/run-macros/tasty-macro-const/quoted_1.scala # tests/run-macros/tasty-macro-positions/quoted_1.scala # tests/run-macros/tasty-original-source/Macros_1.scala # tests/run-macros/tasty-seal-method/quoted_1.scala # tests/run-macros/tasty-simplified/quoted_1.scala # tests/run-macros/tasty-subtyping/quoted_1.scala # tests/run-macros/tasty-tree-map/quoted_1.scala # tests/run-macros/tasty-typeof/Macro_1.scala # tests/run-macros/tasty-unsafe-let/quoted_1.scala # tests/run-macros/type-show/Macro_1.scala # tests/run-macros/xml-interpolation-1/XmlQuote_1.scala # tests/run-macros/xml-interpolation-2/XmlQuote_1.scala # tests/run-macros/xml-interpolation-3/XmlQuote_1.scala # tests/run-with-compiler/i6201/macro_1.scala # tests/run/given-eta.scala
1 parent 54f0a85 commit bfb88cc

File tree

344 files changed

+734
-732
lines changed

Some content is hidden

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

344 files changed

+734
-732
lines changed

tests/disabled/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
@@ -4,7 +4,7 @@ import scala.quoted.autolift.{given _}
44
object Macros {
55

66
inline def foo(i: => Int): Int = ${ fooImpl('i) }
7-
def fooImpl(i: Expr[Int]) with QuoteContext : Expr[Int] = {
7+
def fooImpl(i: Expr[Int])(given QuoteContext): Expr[Int] = {
88
given Toolbox = Toolbox.make(getClass.getClassLoader)
99
val y: Int = run(i)
1010
y

tests/disabled/reflect/run/t3425b/Base_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ object Gen {
2626
}
2727
case class Pair(tp1: Tp, tp2: Tp) {
2828
def expr = s"((new ABC): $tp)"
29-
def tp = s"($tp1) with $tp2"
29+
def tp = s"($tp1) with ($tp2)"
3030
}
3131
val traits = Vector("Any", "A", "B", "C") map ("%6s" format _)
3232
val types = Vector("P", "Q", "R forSome { type R <: P with Q }")
@@ -39,7 +39,7 @@ object Gen {
3939
import p._
4040
List(
4141
s"type R1_$idx = $tp",
42-
s"type R2_$idx = R1_$idx { val y: (${tp1.elem}) with ${tp2.elem} }"
42+
s"type R2_$idx = R1_$idx { val y: (${tp1.elem}) with (${tp2.elem}) }"
4343
)
4444
}
4545

tests/generic-java-signatures/i3653.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Foo {
55
c0: T, c1: T, c2: T, c3: T, c4: T, c5: T, c6: T, c7: T, c8: T, c9: T) => 0
66

77
// #6946
8-
def baz = (x: String ?=> Unit) => x.with("")
8+
def baz = (x: String ?=> Unit) => x(given "")
99
}
1010

1111
object Test {

tests/neg-custom-args/fatal-warnings/quote-simple-hole.scala

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

3-
def test with QuoteContext = {
3+
def test(given QuoteContext) = {
44
val x = '{0}
55
val y = '{ // error: Canceled splice directly inside a quote. '{ ${ XYZ } } is equivalent to XYZ.
66
$x

tests/neg-macros/GenericNumLits/Even_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object Even {
1111
else throw FromDigits.MalformedNumber(s"$digits is odd")
1212
}
1313

14-
private def evenFromDigitsImpl(digits: Expr[String]) with (ctx: QuoteContext) : Expr[Even] = digits match {
14+
private def evenFromDigitsImpl(digits: Expr[String])(given ctx: QuoteContext): Expr[Even] = digits match {
1515
case Const(ds) =>
1616
val ev =
1717
try evenFromDigits(ds)

tests/neg-macros/macro-class-not-found-1/Foo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Foo {
44

55
inline def myMacro(): Unit = ${ aMacroImplementation }
66

7-
def aMacroImplementation with QuoteContext : Expr[Unit] =
7+
def aMacroImplementation(given QuoteContext): Expr[Unit] =
88
throw new NoClassDefFoundError()
99

1010
}

tests/neg-macros/macro-class-not-found-2/Foo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Foo {
44

55
inline def myMacro(): Unit = ${ aMacroImplementation }
66

7-
def aMacroImplementation with QuoteContext : Expr[Unit] =
7+
def aMacroImplementation(given QuoteContext): Expr[Unit] =
88
throw new NoClassDefFoundError("this.is.not.a.Class")
99

1010
}

tests/neg-macros/macros-in-same-project-1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ object Bar {
77

88
inline def myMacro(): Unit = ${ aMacroImplementation }
99

10-
def aMacroImplementation with QuoteContext : Expr[Unit] = '{}
10+
def aMacroImplementation(given QuoteContext): Expr[Unit] = '{}
1111

1212
}

tests/neg-macros/macros-in-same-project-2.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ object Bar {
88
inline def myMacro(): Unit = myMacro2()
99
inline def myMacro2(): Unit = ${ aMacroImplementation }
1010

11-
def aMacroImplementation with QuoteContext : Expr[Unit] = '{}
11+
def aMacroImplementation(given QuoteContext): Expr[Unit] = '{}
1212

1313
}

tests/neg-macros/macros-in-same-project-4/Bar.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ object Bar {
55

66
Foo.myMacro()
77

8-
def hello() with QuoteContext : Expr[Unit] = '{ println("Hello") }
8+
def hello()(given QuoteContext): Expr[Unit] = '{ println("Hello") }
99
}

0 commit comments

Comments
 (0)