Skip to content

Commit 399d8fe

Browse files
committed
Use given instead of implicit for scala.quoted.ExprOps
1 parent 0644841 commit 399d8fe

File tree

74 files changed

+76
-11
lines changed

Some content is hidden

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

74 files changed

+76
-11
lines changed

.gitmodules

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242
url = https://github.com/dotty-staging/scala-xml
4343
[submodule "community-build/community-projects/shapeless"]
4444
path = community-build/community-projects/shapeless
45-
url = https://github.com/milessabin/shapeless
46-
branch = shapeless-3
45+
url = https://github.com/dotty-staging/shapeless
4746
[submodule "community-build/community-projects/xml-interpolator"]
4847
path = community-build/community-projects/xml-interpolator
4948
url = https://github.com/lampepfl/xml-interpolator.git

docs/docs/reference/metaprogramming/macros.md

Lines changed: 1 addition & 0 deletions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package dotty.internal
44

55
import scala.quoted._
6+
import given scala.quoted._
67
import scala.quoted.matching._
78
import reflect._
89

library/src-bootstrapped/scala/quoted/package.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ package object quoted {
66
given autoToExpr[T] as Conversion[T, Expr[T]] given Liftable[T], QuoteContext = _.toExpr
77
}
88

9-
implicit object ExprOps {
9+
given ExprOps {
10+
11+
/** Lift a value into an expression containing the construction of that value */
1012
def (x: T) toExpr[T: Liftable] given QuoteContext: Expr[T] = the[Liftable[T]].toExpr(x)
1113

1214
/** Lifts this sequence of expressions into an expression of a sequence

tests/neg-macros/inline-case-objects/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34

45
object Macros {
56
def impl(foo: Any) given QuoteContext: Expr[String] = foo.getClass.getCanonicalName.toExpr

tests/neg-macros/inline-option/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34

45
object Macro {
56
def impl(opt: Option[Int]) given QuoteContext: Expr[Int] = opt match {

tests/neg-macros/quote-macro-complex-arg-0.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Macros {
45
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

tests/neg-with-compiler/GenericNumLits/Even_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import scala.util.FromDigits
22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.matching._
45

56
case class Even(n: Int)

tests/neg/BigFloat/BigFloat_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package test
22
import scala.util.FromDigits
33
import scala.quoted._
4+
import given scala.quoted._
45
import scala.quoted.matching._
56

67
case class BigFloat(mantissa: BigInt, exponent: Int) {

tests/neg/GenericNumLits/Even_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import scala.util.FromDigits
22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.matching._
45

56
case class Even(n: Int)

tests/pos-macros/quote-whitebox-2/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34

45
object Macro {
56

tests/pos/i5547.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object scalatest {
45
inline def assert1(condition: => Boolean): Unit =

tests/pos/i6214.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
object Test {
34
def res(x: quoted.Expr[Int]) given QuoteContext: quoted.Expr[Int] = x match {
45
case '{ val a: Int = $y; 1} => y // owner of `y` is `res`

tests/pos/quote-lift.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Test {
45
given as QuoteContext = ???

tests/pos/quote-liftable.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
def test given QuoteContext = {
45

tests/run-custom-args/Yretain-trees/tasty-load-tree-1/quoted_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scala.quoted._
2-
2+
import given scala.quoted._
33

44
object Foo {
55

tests/run-custom-args/Yretain-trees/tasty-load-tree-2/quoted_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Foo {
45

tests/run-macros/f-interpolator-neg/Macros_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import given scala.quoted.autolift._
34
import scala.quoted.matching._
45

tests/run-macros/gestalt-type-toolbox-reflect/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// using staging reflection
33

44
import scala.quoted._
5+
import given scala.quoted._
56

67
object TypeToolbox {
78
/** are the two types equal? */

tests/run-macros/i5629/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Macros {
45

tests/run-macros/inline-case-objects/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34

45
object Macros {
56
def impl(foo: Any) given QuoteContext: Expr[String] = foo.getClass.getCanonicalName.toExpr

tests/run-macros/inline-macro-staged-interpreter/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34

45
object E {
56

tests/run-macros/quote-matcher-runtime/quoted_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.matching._
34

45

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.matching._
34

45

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.matching._
34

45

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.matching._
34

45

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.matching._
45

56
object Macros {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.matching._
34

45
object Macros {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.matching._
34

45
object Macros {

tests/run-macros/quote-toExprOfTuple/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Macro {
45
inline def t2[T0, T1](t0: T0, t1: T1): (T0, T1) = ${ impl2('{t0}, '{t1}) }

tests/run-macros/reflect-inline/assert_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object api {
45
inline def (inline x: String) stripMargin: String =

tests/run-macros/reflect-isFunctionType/macro_1.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import scala.quoted._
2-
2+
import given scala.quoted._
33

44
inline def isFunctionType[T:Type]: Boolean = ${ isFunctionTypeImpl('[T]) }
55

@@ -30,4 +30,3 @@ def isDependentFunctionTypeImpl[T](tp: Type[T]) given (qctx: QuoteContext): Expr
3030
import qctx.tasty._
3131
tp.unseal.tpe.isDependentFunctionType.toExpr
3232
}
33-

tests/run-macros/reflect-typeChecks/assert_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object scalatest {
45

tests/run-macros/tasty-dealias/quoted_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Macros {
45

tests/run-macros/tasty-extractors-constants-1/quoted_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import given scala.quoted.autolift._
34

45
import scala.quoted.matching._

tests/run-macros/tasty-interpolation-1/Macro.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.language.implicitConversions
45
import given scala.quoted.autolift._
56

tests/run-macros/tasty-macro-positions/quoted_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object Macros {
45

tests/run-macros/tasty-simplified/quoted_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import scala.annotation.tailrec
22
import scala.quoted._
3+
import given scala.quoted._
34

45
object Macros {
56

tests/run-macros/tasty-string-interpolation-reporter-test/Macros_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import given scala.quoted.autolift._
34
import scala.quoted.matching._
45

tests/run-macros/type-show/Macro_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23

34
object TypeToolbox {
45
inline def show[A]: String = ${ showImpl('[A]) }

tests/run-macros/xml-interpolation-2/XmlQuote_1.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import given scala.quoted.autolift._
45

56

tests/run-staging/i3847-b.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.staging._
34
import scala.reflect.ClassTag
45

tests/run-staging/i3847.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.staging._
34
import scala.reflect.ClassTag
45

tests/run-staging/i3947.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947b.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947b2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947b3.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947c.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947d.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45
object Test {
56
delegate for Toolbox = Toolbox.make(getClass.getClassLoader)

tests/run-staging/i3947d2.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947e.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947f.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947g.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947i.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i3947j.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
import scala.quoted._
3+
import given scala.quoted._
34
import scala.quoted.staging._
45

56
object Test {

tests/run-staging/i4730.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import scala.quoted._
2+
import given scala.quoted._
23
import scala.quoted.staging._
34

45
object Test {

0 commit comments

Comments
 (0)