From b9ddebd0671aaf9c88535ed3638719793e73ecad Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 6 Sep 2019 13:17:25 +0200 Subject: [PATCH 1/3] Use given instead of implicit --- library/src/scala/quoted/ValueOfExpr.scala | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/library/src/scala/quoted/ValueOfExpr.scala b/library/src/scala/quoted/ValueOfExpr.scala index 32d27feb5246..790a2438c0c9 100644 --- a/library/src/scala/quoted/ValueOfExpr.scala +++ b/library/src/scala/quoted/ValueOfExpr.scala @@ -14,16 +14,16 @@ trait ValueOfExpr[T] { object ValueOfExpr { - implicit val ValueOfExpr_Unit_delegate: ValueOfExpr[Unit] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Boolean_delegate: ValueOfExpr[Boolean] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Byte_delegate: ValueOfExpr[Byte] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Short_delegate: ValueOfExpr[Short] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Int_delegate: ValueOfExpr[Int] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Long_delegate: ValueOfExpr[Long] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Float_delegate: ValueOfExpr[Float] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Double_delegate: ValueOfExpr[Double] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_Char_delegate: ValueOfExpr[Char] = new PrimitiveValueOfExpr - implicit val ValueOfExpr_String_delegate: ValueOfExpr[String] = new PrimitiveValueOfExpr + given ValueOfExpr_Unit_delegate as ValueOfExpr[Unit] = new PrimitiveValueOfExpr + given ValueOfExpr_Boolean_delegate as ValueOfExpr[Boolean] = new PrimitiveValueOfExpr + given ValueOfExpr_Byte_delegate as ValueOfExpr[Byte] = new PrimitiveValueOfExpr + given ValueOfExpr_Short_delegate as ValueOfExpr[Short] = new PrimitiveValueOfExpr + given ValueOfExpr_Int_delegate as ValueOfExpr[Int] = new PrimitiveValueOfExpr + given ValueOfExpr_Long_delegate as ValueOfExpr[Long] = new PrimitiveValueOfExpr + given ValueOfExpr_Float_delegate as ValueOfExpr[Float] = new PrimitiveValueOfExpr + given ValueOfExpr_Double_delegate as ValueOfExpr[Double] = new PrimitiveValueOfExpr + given ValueOfExpr_Char_delegate as ValueOfExpr[Char] = new PrimitiveValueOfExpr + given ValueOfExpr_String_delegate as ValueOfExpr[String] = new PrimitiveValueOfExpr private class PrimitiveValueOfExpr[T <: Unit | Null | Int | Boolean | Byte | Short | Int | Long | Float | Double | Char | String] extends ValueOfExpr[T] { /** Lift a quoted primitive value `'{ n }` into `n` */ From 097aa5cfefa957b6562cc36987392e4aa31b78d4 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 6 Sep 2019 14:48:07 +0200 Subject: [PATCH 2/3] Use given instead of implicit arguments --- library/src/scala/quoted/Expr.scala | 2 +- library/src/scala/quoted/Type.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/scala/quoted/Expr.scala b/library/src/scala/quoted/Expr.scala index 0bc9d5b0a60b..6f314018fbd4 100644 --- a/library/src/scala/quoted/Expr.scala +++ b/library/src/scala/quoted/Expr.scala @@ -60,7 +60,7 @@ package quoted { * Given list of statements `s1 :: s2 :: ... :: Nil` and an expression `e` the resulting expression * will be equivalent to `'{ $s1; $s2; ...; $e }`. */ - def block[T](statements: List[Expr[_]], expr: Expr[T])(implicit qctx: QuoteContext): Expr[T] = { + def block[T](statements: List[Expr[_]], expr: Expr[T]) given (qctx: QuoteContext): Expr[T] = { import qctx.tasty._ Block(statements.map(_.unseal), expr.unseal).seal.asInstanceOf[Expr[T]] } diff --git a/library/src/scala/quoted/Type.scala b/library/src/scala/quoted/Type.scala index 049e9a97da3b..4146a8ffdd08 100644 --- a/library/src/scala/quoted/Type.scala +++ b/library/src/scala/quoted/Type.scala @@ -7,10 +7,10 @@ package quoted { type `$splice` = T /** Show a source code like representation of this type without syntax highlight */ - def show(implicit qctx: QuoteContext): String = qctx.show(this, SyntaxHighlight.plain) + def show given (qctx: QuoteContext): String = qctx.show(this, SyntaxHighlight.plain) /** Show a source code like representation of this type */ - def show(syntaxHighlight: SyntaxHighlight)(implicit qctx: QuoteContext): String = qctx.show(this, syntaxHighlight) + def show(syntaxHighlight: SyntaxHighlight) given (qctx: QuoteContext): String = qctx.show(this, syntaxHighlight) } From 6ca467612ec915cba590cdb232d827881f9c5816 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 6 Sep 2019 15:03:22 +0200 Subject: [PATCH 3/3] Use given instead of implicit for scala.quoted.ExprOps --- .gitmodules | 3 +-- community-build/community-projects/minitest | 2 +- community-build/community-projects/scalatest | 2 +- community-build/community-projects/shapeless | 2 +- community-build/community-projects/sourcecode | 2 +- community-build/community-projects/xml-interpolator | 2 +- docs/docs/reference/metaprogramming/macros.md | 1 + .../src-bootstrapped/dotty/internal/StringContextMacro.scala | 1 + library/src-bootstrapped/scala/quoted/package.scala | 4 +++- tests/neg-macros/inline-case-objects/Macro_1.scala | 1 + tests/neg-macros/inline-option/Macro_1.scala | 1 + tests/neg-macros/quote-macro-complex-arg-0.scala | 1 + tests/neg-with-compiler/GenericNumLits/Even_1.scala | 1 + tests/neg/BigFloat/BigFloat_1.scala | 1 + tests/neg/GenericNumLits/Even_1.scala | 1 + tests/pos-macros/quote-whitebox-2/Macro_1.scala | 1 + tests/pos/i5547.scala | 1 + tests/pos/i6214.scala | 1 + tests/pos/quote-lift.scala | 1 + tests/pos/quote-liftable.scala | 1 + .../Yretain-trees/tasty-load-tree-1/quoted_1.scala | 2 +- .../Yretain-trees/tasty-load-tree-2/quoted_1.scala | 1 + tests/run-macros/f-interpolator-neg/Macros_1.scala | 1 + tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala | 1 + tests/run-macros/i5629/Macro_1.scala | 1 + tests/run-macros/inline-case-objects/Macro_1.scala | 1 + .../run-macros/inline-macro-staged-interpreter/Macro_1.scala | 1 + tests/run-macros/quote-matcher-runtime/quoted_1.scala | 1 + .../quote-matcher-string-interpolator-2/quoted_1.scala | 1 + .../quote-matcher-string-interpolator-3/quoted_1.scala | 1 + .../quote-matcher-string-interpolator/quoted_1.scala | 1 + tests/run-macros/quote-matcher-symantics-1/quoted_1.scala | 1 + tests/run-macros/quote-matcher-symantics-2/quoted_1.scala | 1 + tests/run-macros/quote-matcher-symantics-3/quoted_1.scala | 1 + tests/run-macros/quote-toExprOfTuple/Macro_1.scala | 1 + tests/run-macros/reflect-inline/assert_1.scala | 1 + tests/run-macros/reflect-isFunctionType/macro_1.scala | 3 +-- tests/run-macros/reflect-typeChecks/assert_1.scala | 1 + tests/run-macros/tasty-dealias/quoted_1.scala | 1 + tests/run-macros/tasty-extractors-constants-1/quoted_1.scala | 1 + tests/run-macros/tasty-interpolation-1/Macro.scala | 1 + tests/run-macros/tasty-macro-positions/quoted_1.scala | 1 + tests/run-macros/tasty-simplified/quoted_1.scala | 1 + .../tasty-string-interpolation-reporter-test/Macros_1.scala | 1 + tests/run-macros/type-show/Macro_1.scala | 1 + tests/run-macros/xml-interpolation-2/XmlQuote_1.scala | 1 + tests/run-staging/i3847-b.scala | 1 + tests/run-staging/i3847.scala | 1 + tests/run-staging/i3947.scala | 1 + tests/run-staging/i3947b.scala | 1 + tests/run-staging/i3947b2.scala | 1 + tests/run-staging/i3947b3.scala | 1 + tests/run-staging/i3947c.scala | 1 + tests/run-staging/i3947d.scala | 1 + tests/run-staging/i3947d2.scala | 1 + tests/run-staging/i3947e.scala | 1 + tests/run-staging/i3947f.scala | 1 + tests/run-staging/i3947g.scala | 1 + tests/run-staging/i3947i.scala | 1 + tests/run-staging/i3947j.scala | 1 + tests/run-staging/i4730.scala | 1 + tests/run-staging/i5161.scala | 1 + tests/run-staging/quote-lift-BigDecimal.scala | 1 + tests/run-staging/quote-lift-BigInt.scala | 1 + tests/run-staging/quote-macro-in-splice/quoted_2.scala | 1 + tests/run-staging/quote-toExprOfTuple.scala | 1 + tests/run-staging/shonan-hmm-simple.scala | 1 + tests/run-staging/shonan-hmm/Complex.scala | 1 + tests/run-staging/shonan-hmm/PV.scala | 1 + tests/run-staging/staged-tuples/StagedTuple.scala | 1 + tests/run-with-compiler/BigFloat/BigFloat_1.scala | 1 + tests/run-with-compiler/i6201/macro_1.scala | 1 + tests/run-with-compiler/i6270/Macro_1.scala | 1 + tests/run-with-compiler/reflect-sourceCode/Macro_1.scala | 1 + 74 files changed, 76 insertions(+), 11 deletions(-) diff --git a/.gitmodules b/.gitmodules index de045a725963..584613c02835 100644 --- a/.gitmodules +++ b/.gitmodules @@ -42,8 +42,7 @@ url = https://github.com/dotty-staging/scala-xml [submodule "community-build/community-projects/shapeless"] path = community-build/community-projects/shapeless - url = https://github.com/milessabin/shapeless - branch = shapeless-3 + url = https://github.com/dotty-staging/shapeless [submodule "community-build/community-projects/xml-interpolator"] path = community-build/community-projects/xml-interpolator url = https://github.com/lampepfl/xml-interpolator.git diff --git a/community-build/community-projects/minitest b/community-build/community-projects/minitest index eaddd4dde4b8..e77ef15b5160 160000 --- a/community-build/community-projects/minitest +++ b/community-build/community-projects/minitest @@ -1 +1 @@ -Subproject commit eaddd4dde4b8a84ddf62a20a781b939a135b3ea1 +Subproject commit e77ef15b5160df1239ba31e118262b37f72aab2b diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 0cf1ffad398c..fcb5e585ff79 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 0cf1ffad398c60c1b1fe995158e543bb5bfce310 +Subproject commit fcb5e585ff79e6947863b5cf2cbafd922c36d5c4 diff --git a/community-build/community-projects/shapeless b/community-build/community-projects/shapeless index ab34097be4a4..d6315fb75684 160000 --- a/community-build/community-projects/shapeless +++ b/community-build/community-projects/shapeless @@ -1 +1 @@ -Subproject commit ab34097be4a47138dd10e5c816ce7173a793375d +Subproject commit d6315fb75684813fb44842c048b31385e125a75a diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index b23462bbaf37..5cb4de46fe07 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit b23462bbaf3781e27fd54970a76b265cb2ae7e71 +Subproject commit 5cb4de46fe076ad25614b96590953db27caf5b56 diff --git a/community-build/community-projects/xml-interpolator b/community-build/community-projects/xml-interpolator index ce42d5bf7d00..4952ae212090 160000 --- a/community-build/community-projects/xml-interpolator +++ b/community-build/community-projects/xml-interpolator @@ -1 +1 @@ -Subproject commit ce42d5bf7d00239aedf3bbf9d7ad8319216d9391 +Subproject commit 4952ae212090ca864dd3c717027a0863419af228 diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index cb6a057ba190..1491cd8c2b7a 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -224,6 +224,7 @@ Here’s a compiler that maps an expression given in the interpreted language to quoted Scala code of type `Expr[Int]`. The compiler takes an environment that maps variable names to Scala `Expr`s. ```scala + import scala.quoted._ import given scala.quoted._ def compile(e: Exp, env: Map[String, Expr[Int]]): Expr[Int] = e match { diff --git a/library/src-bootstrapped/dotty/internal/StringContextMacro.scala b/library/src-bootstrapped/dotty/internal/StringContextMacro.scala index 1303451853fb..e9a0c3f26526 100644 --- a/library/src-bootstrapped/dotty/internal/StringContextMacro.scala +++ b/library/src-bootstrapped/dotty/internal/StringContextMacro.scala @@ -3,6 +3,7 @@ package dotty.internal import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ import reflect._ diff --git a/library/src-bootstrapped/scala/quoted/package.scala b/library/src-bootstrapped/scala/quoted/package.scala index 10d4aefd5bcb..fc264c164e86 100644 --- a/library/src-bootstrapped/scala/quoted/package.scala +++ b/library/src-bootstrapped/scala/quoted/package.scala @@ -6,7 +6,9 @@ package object quoted { given autoToExpr[T] as Conversion[T, Expr[T]] given Liftable[T], QuoteContext = _.toExpr } - implicit object ExprOps { + given ExprOps { + + /** Lift a value into an expression containing the construction of that value */ def (x: T) toExpr[T: Liftable] given QuoteContext: Expr[T] = the[Liftable[T]].toExpr(x) /** Lifts this sequence of expressions into an expression of a sequence diff --git a/tests/neg-macros/inline-case-objects/Macro_1.scala b/tests/neg-macros/inline-case-objects/Macro_1.scala index c52792b2a7c9..5be809b9b555 100644 --- a/tests/neg-macros/inline-case-objects/Macro_1.scala +++ b/tests/neg-macros/inline-case-objects/Macro_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ object Macros { def impl(foo: Any) given QuoteContext: Expr[String] = foo.getClass.getCanonicalName.toExpr diff --git a/tests/neg-macros/inline-option/Macro_1.scala b/tests/neg-macros/inline-option/Macro_1.scala index 4cdc75b23d01..e07e8bb5d275 100644 --- a/tests/neg-macros/inline-option/Macro_1.scala +++ b/tests/neg-macros/inline-option/Macro_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ object Macro { def impl(opt: Option[Int]) given QuoteContext: Expr[Int] = opt match { diff --git a/tests/neg-macros/quote-macro-complex-arg-0.scala b/tests/neg-macros/quote-macro-complex-arg-0.scala index b4ebf0abba1b..04cfa111e0f5 100644 --- a/tests/neg-macros/quote-macro-complex-arg-0.scala +++ b/tests/neg-macros/quote-macro-complex-arg-0.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Macros { inline def foo(inline i: Int, dummy: Int, j: Int): Int = ${ bar(i + 1, 'j) } // error: i + 1 is not a parameter or field reference diff --git a/tests/neg-with-compiler/GenericNumLits/Even_1.scala b/tests/neg-with-compiler/GenericNumLits/Even_1.scala index be5a8b466381..62ae0ed81f85 100644 --- a/tests/neg-with-compiler/GenericNumLits/Even_1.scala +++ b/tests/neg-with-compiler/GenericNumLits/Even_1.scala @@ -1,5 +1,6 @@ import scala.util.FromDigits import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ case class Even(n: Int) diff --git a/tests/neg/BigFloat/BigFloat_1.scala b/tests/neg/BigFloat/BigFloat_1.scala index ad8439368670..6b412ef63fd2 100644 --- a/tests/neg/BigFloat/BigFloat_1.scala +++ b/tests/neg/BigFloat/BigFloat_1.scala @@ -1,6 +1,7 @@ package test import scala.util.FromDigits import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ case class BigFloat(mantissa: BigInt, exponent: Int) { diff --git a/tests/neg/GenericNumLits/Even_1.scala b/tests/neg/GenericNumLits/Even_1.scala index be5a8b466381..62ae0ed81f85 100644 --- a/tests/neg/GenericNumLits/Even_1.scala +++ b/tests/neg/GenericNumLits/Even_1.scala @@ -1,5 +1,6 @@ import scala.util.FromDigits import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ case class Even(n: Int) diff --git a/tests/pos-macros/quote-whitebox-2/Macro_1.scala b/tests/pos-macros/quote-whitebox-2/Macro_1.scala index 25c9a8b775be..e4888bdaf226 100644 --- a/tests/pos-macros/quote-whitebox-2/Macro_1.scala +++ b/tests/pos-macros/quote-whitebox-2/Macro_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ object Macro { diff --git a/tests/pos/i5547.scala b/tests/pos/i5547.scala index b62c0fa07982..b3038d331f9d 100644 --- a/tests/pos/i5547.scala +++ b/tests/pos/i5547.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object scalatest { inline def assert1(condition: => Boolean): Unit = diff --git a/tests/pos/i6214.scala b/tests/pos/i6214.scala index c45409435ea5..6f1f07bdd823 100644 --- a/tests/pos/i6214.scala +++ b/tests/pos/i6214.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Test { def res(x: quoted.Expr[Int]) given QuoteContext: quoted.Expr[Int] = x match { case '{ val a: Int = $y; 1} => y // owner of `y` is `res` diff --git a/tests/pos/quote-lift.scala b/tests/pos/quote-lift.scala index 3db9c5995df6..9bc5786c715b 100644 --- a/tests/pos/quote-lift.scala +++ b/tests/pos/quote-lift.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Test { given as QuoteContext = ??? diff --git a/tests/pos/quote-liftable.scala b/tests/pos/quote-liftable.scala index 9e60b1f45f33..bd834fe3013e 100644 --- a/tests/pos/quote-liftable.scala +++ b/tests/pos/quote-liftable.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ def test given QuoteContext = { diff --git a/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala b/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala index 9291e97e3da0..d05cbe53cac1 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ - +import given scala.quoted._ object Foo { diff --git a/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala b/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala index 70945b772266..ccea04b92a05 100644 --- a/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala +++ b/tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Foo { diff --git a/tests/run-macros/f-interpolator-neg/Macros_1.scala b/tests/run-macros/f-interpolator-neg/Macros_1.scala index e7916126b21b..99d0c84e23cd 100644 --- a/tests/run-macros/f-interpolator-neg/Macros_1.scala +++ b/tests/run-macros/f-interpolator-neg/Macros_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import given scala.quoted.autolift._ import scala.quoted.matching._ diff --git a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala index c6b51cc1e1ec..a98f7250f5f7 100644 --- a/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala +++ b/tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala @@ -2,6 +2,7 @@ // using staging reflection import scala.quoted._ +import given scala.quoted._ object TypeToolbox { /** are the two types equal? */ diff --git a/tests/run-macros/i5629/Macro_1.scala b/tests/run-macros/i5629/Macro_1.scala index 7036e66e9207..33c5c380c898 100644 --- a/tests/run-macros/i5629/Macro_1.scala +++ b/tests/run-macros/i5629/Macro_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Macros { diff --git a/tests/run-macros/inline-case-objects/Macro_1.scala b/tests/run-macros/inline-case-objects/Macro_1.scala index 3fddb091dab5..4acc31c79506 100644 --- a/tests/run-macros/inline-case-objects/Macro_1.scala +++ b/tests/run-macros/inline-case-objects/Macro_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ object Macros { def impl(foo: Any) given QuoteContext: Expr[String] = foo.getClass.getCanonicalName.toExpr diff --git a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala index f4be1f587b23..11407a41ff18 100644 --- a/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala +++ b/tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ object E { diff --git a/tests/run-macros/quote-matcher-runtime/quoted_1.scala b/tests/run-macros/quote-matcher-runtime/quoted_1.scala index de2b3a777736..9209def364b6 100644 --- a/tests/run-macros/quote-matcher-runtime/quoted_1.scala +++ b/tests/run-macros/quote-matcher-runtime/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ 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 fe1a1a22f1ef..8eff24fdcdc3 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 @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ 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 5e8d5f4fbfaa..bec3bdf26abf 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 @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ 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 bdc9b16c15bf..08458f418225 100644 --- a/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala +++ b/tests/run-macros/quote-matcher-string-interpolator/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ 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 3add72815945..094cdd710cf8 100644 --- a/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-1/quoted_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ object Macros { 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 9641fbaf8718..605e15f95ecd 100644 --- a/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-2/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ object Macros { 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 28c1df72dd7f..9902eb988fed 100644 --- a/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala +++ b/tests/run-macros/quote-matcher-symantics-3/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ object Macros { diff --git a/tests/run-macros/quote-toExprOfTuple/Macro_1.scala b/tests/run-macros/quote-toExprOfTuple/Macro_1.scala index e9a252e4c673..982390f6b88f 100644 --- a/tests/run-macros/quote-toExprOfTuple/Macro_1.scala +++ b/tests/run-macros/quote-toExprOfTuple/Macro_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Macro { inline def t2[T0, T1](t0: T0, t1: T1): (T0, T1) = ${ impl2('{t0}, '{t1}) } diff --git a/tests/run-macros/reflect-inline/assert_1.scala b/tests/run-macros/reflect-inline/assert_1.scala index 45d7a4d73186..e63197429155 100644 --- a/tests/run-macros/reflect-inline/assert_1.scala +++ b/tests/run-macros/reflect-inline/assert_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object api { inline def (inline x: String) stripMargin: String = diff --git a/tests/run-macros/reflect-isFunctionType/macro_1.scala b/tests/run-macros/reflect-isFunctionType/macro_1.scala index 0c4e91861ec0..9bd149d4284b 100644 --- a/tests/run-macros/reflect-isFunctionType/macro_1.scala +++ b/tests/run-macros/reflect-isFunctionType/macro_1.scala @@ -1,5 +1,5 @@ import scala.quoted._ - +import given scala.quoted._ inline def isFunctionType[T:Type]: Boolean = ${ isFunctionTypeImpl('[T]) } @@ -30,4 +30,3 @@ def isDependentFunctionTypeImpl[T](tp: Type[T]) given (qctx: QuoteContext): Expr import qctx.tasty._ tp.unseal.tpe.isDependentFunctionType.toExpr } - diff --git a/tests/run-macros/reflect-typeChecks/assert_1.scala b/tests/run-macros/reflect-typeChecks/assert_1.scala index 25f604ad8e4d..71272d0a15a2 100644 --- a/tests/run-macros/reflect-typeChecks/assert_1.scala +++ b/tests/run-macros/reflect-typeChecks/assert_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object scalatest { diff --git a/tests/run-macros/tasty-dealias/quoted_1.scala b/tests/run-macros/tasty-dealias/quoted_1.scala index e4332f2652b7..6b32d93766d0 100644 --- a/tests/run-macros/tasty-dealias/quoted_1.scala +++ b/tests/run-macros/tasty-dealias/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Macros { diff --git a/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala b/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala index ca421afe4f26..b27f1976c12f 100644 --- a/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala +++ b/tests/run-macros/tasty-extractors-constants-1/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import given scala.quoted.autolift._ import scala.quoted.matching._ diff --git a/tests/run-macros/tasty-interpolation-1/Macro.scala b/tests/run-macros/tasty-interpolation-1/Macro.scala index 6534b0cb93d8..dc3a3a3b6b98 100644 --- a/tests/run-macros/tasty-interpolation-1/Macro.scala +++ b/tests/run-macros/tasty-interpolation-1/Macro.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.language.implicitConversions import given scala.quoted.autolift._ diff --git a/tests/run-macros/tasty-macro-positions/quoted_1.scala b/tests/run-macros/tasty-macro-positions/quoted_1.scala index b32977a22cbf..1f373be0e758 100644 --- a/tests/run-macros/tasty-macro-positions/quoted_1.scala +++ b/tests/run-macros/tasty-macro-positions/quoted_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object Macros { diff --git a/tests/run-macros/tasty-simplified/quoted_1.scala b/tests/run-macros/tasty-simplified/quoted_1.scala index 300efd03ff8d..043b1a3f08d7 100644 --- a/tests/run-macros/tasty-simplified/quoted_1.scala +++ b/tests/run-macros/tasty-simplified/quoted_1.scala @@ -1,5 +1,6 @@ import scala.annotation.tailrec import scala.quoted._ +import given scala.quoted._ object Macros { diff --git a/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala b/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala index 8f28a102a001..cb854ef665c1 100644 --- a/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala +++ b/tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import given scala.quoted.autolift._ import scala.quoted.matching._ diff --git a/tests/run-macros/type-show/Macro_1.scala b/tests/run-macros/type-show/Macro_1.scala index 64d096a03394..504a16aa1c46 100644 --- a/tests/run-macros/type-show/Macro_1.scala +++ b/tests/run-macros/type-show/Macro_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object TypeToolbox { inline def show[A]: String = ${ showImpl('[A]) } diff --git a/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala b/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala index 4638ca42a39a..fb835a29f224 100644 --- a/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala +++ b/tests/run-macros/xml-interpolation-2/XmlQuote_1.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import given scala.quoted.autolift._ diff --git a/tests/run-staging/i3847-b.scala b/tests/run-staging/i3847-b.scala index 0b28e31a7aef..d5230c7f60bb 100644 --- a/tests/run-staging/i3847-b.scala +++ b/tests/run-staging/i3847-b.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ import scala.reflect.ClassTag diff --git a/tests/run-staging/i3847.scala b/tests/run-staging/i3847.scala index d6f08ce029cb..6764cefe212a 100644 --- a/tests/run-staging/i3847.scala +++ b/tests/run-staging/i3847.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ import scala.reflect.ClassTag diff --git a/tests/run-staging/i3947.scala b/tests/run-staging/i3947.scala index d4f302024611..fcec03129b06 100644 --- a/tests/run-staging/i3947.scala +++ b/tests/run-staging/i3947.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947b.scala b/tests/run-staging/i3947b.scala index a8fd34908d6c..c15442548a77 100644 --- a/tests/run-staging/i3947b.scala +++ b/tests/run-staging/i3947b.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947b2.scala b/tests/run-staging/i3947b2.scala index 26d9a3e4ee7e..c06dcf660af4 100644 --- a/tests/run-staging/i3947b2.scala +++ b/tests/run-staging/i3947b2.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947b3.scala b/tests/run-staging/i3947b3.scala index 35eb2a341935..28725fe54c2c 100644 --- a/tests/run-staging/i3947b3.scala +++ b/tests/run-staging/i3947b3.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947c.scala b/tests/run-staging/i3947c.scala index 40a627aa319e..09104267c836 100644 --- a/tests/run-staging/i3947c.scala +++ b/tests/run-staging/i3947c.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947d.scala b/tests/run-staging/i3947d.scala index 0535ac8be357..8ac4569259d8 100644 --- a/tests/run-staging/i3947d.scala +++ b/tests/run-staging/i3947d.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { delegate for Toolbox = Toolbox.make(getClass.getClassLoader) diff --git a/tests/run-staging/i3947d2.scala b/tests/run-staging/i3947d2.scala index b0fd5cceb96a..6c809738681f 100644 --- a/tests/run-staging/i3947d2.scala +++ b/tests/run-staging/i3947d2.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947e.scala b/tests/run-staging/i3947e.scala index 8b2de380f54a..f37cdd545870 100644 --- a/tests/run-staging/i3947e.scala +++ b/tests/run-staging/i3947e.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947f.scala b/tests/run-staging/i3947f.scala index 3134f863dd2e..33079c81e1ce 100644 --- a/tests/run-staging/i3947f.scala +++ b/tests/run-staging/i3947f.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947g.scala b/tests/run-staging/i3947g.scala index fba24a4818ce..667b497ae6cd 100644 --- a/tests/run-staging/i3947g.scala +++ b/tests/run-staging/i3947g.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947i.scala b/tests/run-staging/i3947i.scala index 1e1ca59a34fd..cf9ab60d1df6 100644 --- a/tests/run-staging/i3947i.scala +++ b/tests/run-staging/i3947i.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i3947j.scala b/tests/run-staging/i3947j.scala index 32a2225eb45a..7acce86815e6 100644 --- a/tests/run-staging/i3947j.scala +++ b/tests/run-staging/i3947j.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i4730.scala b/tests/run-staging/i4730.scala index 9c27c328f9ee..3e0223f258a2 100644 --- a/tests/run-staging/i4730.scala +++ b/tests/run-staging/i4730.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/i5161.scala b/tests/run-staging/i5161.scala index 12a9c086323b..294845fc98c6 100644 --- a/tests/run-staging/i5161.scala +++ b/tests/run-staging/i5161.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/quote-lift-BigDecimal.scala b/tests/run-staging/quote-lift-BigDecimal.scala index 21b45c4149da..9ca670cf4fc5 100644 --- a/tests/run-staging/quote-lift-BigDecimal.scala +++ b/tests/run-staging/quote-lift-BigDecimal.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { delegate for Toolbox = Toolbox.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-lift-BigInt.scala b/tests/run-staging/quote-lift-BigInt.scala index 33a5393a2afd..d86a3a66c454 100644 --- a/tests/run-staging/quote-lift-BigInt.scala +++ b/tests/run-staging/quote-lift-BigInt.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { delegate for Toolbox = Toolbox.make(getClass.getClassLoader) diff --git a/tests/run-staging/quote-macro-in-splice/quoted_2.scala b/tests/run-staging/quote-macro-in-splice/quoted_2.scala index 7259bead222f..748f65bbd62f 100644 --- a/tests/run-staging/quote-macro-in-splice/quoted_2.scala +++ b/tests/run-staging/quote-macro-in-splice/quoted_2.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ import Macros._ diff --git a/tests/run-staging/quote-toExprOfTuple.scala b/tests/run-staging/quote-toExprOfTuple.scala index bee761679d22..50148b2a026f 100644 --- a/tests/run-staging/quote-toExprOfTuple.scala +++ b/tests/run-staging/quote-toExprOfTuple.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ object Test { diff --git a/tests/run-staging/shonan-hmm-simple.scala b/tests/run-staging/shonan-hmm-simple.scala index fbd98a8b6a9e..43e2bacf6d2d 100644 --- a/tests/run-staging/shonan-hmm-simple.scala +++ b/tests/run-staging/shonan-hmm-simple.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.staging._ import given scala.quoted.autolift._ diff --git a/tests/run-staging/shonan-hmm/Complex.scala b/tests/run-staging/shonan-hmm/Complex.scala index 8fe5ac91a4ea..c2485afa7a95 100644 --- a/tests/run-staging/shonan-hmm/Complex.scala +++ b/tests/run-staging/shonan-hmm/Complex.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ case class Complex[T](re: T, im: T) diff --git a/tests/run-staging/shonan-hmm/PV.scala b/tests/run-staging/shonan-hmm/PV.scala index 3247209e172c..bfeb12d3a171 100644 --- a/tests/run-staging/shonan-hmm/PV.scala +++ b/tests/run-staging/shonan-hmm/PV.scala @@ -1,5 +1,6 @@ import scala.quoted._ +import given scala.quoted._ sealed trait PV[T] diff --git a/tests/run-staging/staged-tuples/StagedTuple.scala b/tests/run-staging/staged-tuples/StagedTuple.scala index f91b911ffd87..a8e5191581f9 100644 --- a/tests/run-staging/staged-tuples/StagedTuple.scala +++ b/tests/run-staging/staged-tuples/StagedTuple.scala @@ -1,6 +1,7 @@ package scala.internal import scala.quoted._ +import given scala.quoted._ object StagedTuple { import Tuple.Concat diff --git a/tests/run-with-compiler/BigFloat/BigFloat_1.scala b/tests/run-with-compiler/BigFloat/BigFloat_1.scala index ad8439368670..6b412ef63fd2 100644 --- a/tests/run-with-compiler/BigFloat/BigFloat_1.scala +++ b/tests/run-with-compiler/BigFloat/BigFloat_1.scala @@ -1,6 +1,7 @@ package test import scala.util.FromDigits import scala.quoted._ +import given scala.quoted._ import scala.quoted.matching._ case class BigFloat(mantissa: BigInt, exponent: Int) { diff --git a/tests/run-with-compiler/i6201/macro_1.scala b/tests/run-with-compiler/i6201/macro_1.scala index cbbad024cdd8..fc06f46c4f0c 100644 --- a/tests/run-with-compiler/i6201/macro_1.scala +++ b/tests/run-with-compiler/i6201/macro_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ inline def (inline x: String) strip: String = ${ stripImpl(x) } diff --git a/tests/run-with-compiler/i6270/Macro_1.scala b/tests/run-with-compiler/i6270/Macro_1.scala index f9efa6195667..9dda79acf1d7 100644 --- a/tests/run-with-compiler/i6270/Macro_1.scala +++ b/tests/run-with-compiler/i6270/Macro_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ import scala.quoted.show.SyntaxHighlight.ANSI object api { diff --git a/tests/run-with-compiler/reflect-sourceCode/Macro_1.scala b/tests/run-with-compiler/reflect-sourceCode/Macro_1.scala index 261f258bd297..2acda6ae9688 100644 --- a/tests/run-with-compiler/reflect-sourceCode/Macro_1.scala +++ b/tests/run-with-compiler/reflect-sourceCode/Macro_1.scala @@ -1,4 +1,5 @@ import scala.quoted._ +import given scala.quoted._ object api { inline def (x: => T) reflect[T] : String =