Skip to content

Commit e94662a

Browse files
Merge pull request #6841 from dotty-staging/remove-useless-implicit
Remove useless implicit
2 parents 829a8c9 + b1d50a6 commit e94662a

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

library/src/scala/quoted/QuoteContext.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,5 @@ class QuoteContext(val tasty: scala.tasty.Reflection) {
4949
}
5050

5151
object QuoteContext {
52-
// TODO remove in 0.18
53-
// For backward compat with macros
54-
@deprecated("Provide scala.quoted.QuoteContext instead of using a scala.tasty.Reflection", "0.17")
55-
implicit def reflectionToQuoteContext(implicit reflect: tasty.Reflection): scala.quoted.QuoteContext =
56-
new scala.quoted.QuoteContext(reflect)
57-
5852
def macroContext: QuoteContext = throw new Exception("Not in inline macro.")
5953
}

tests/neg/quotedPatterns-5.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import scala.quoted._
12
object Test {
2-
def test(x: quoted.Expr[Int]) given tasty.Reflection = x match {
3+
def test(x: quoted.Expr[Int]) given QuoteContext = x match {
34
case '{ type $t; poly[$t]($x); 4 } => ??? // error: duplicate pattern variable: $t
45
case '{ type `$t`; poly[`$t`]($x); 4 } =>
56
val tt: quoted.Type[_] = t // error

tests/pos/quote-matching-implicit-types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
object Foo {
44

5-
def f(e: Expr[Any]) given tasty.Reflection : Unit = e match {
5+
def f(e: Expr[Any]) given QuoteContext: Unit = e match {
66
case '{ foo[$t]($x) } => bar(x)
77
case '{ foo[$t]($x) } if bar(x) => ()
88
case '{ foo[$t]($x) } => '{ foo($x) }

tests/pos/quoted-pattern-type.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import scala.tasty.Reflection
33

44
object Lib {
55

6-
def impl[T: Type](arg: Expr[T])(implicit refl: Reflection): Expr[T] = {
6+
def impl[T: Type](arg: Expr[T]) given QuoteContext: Expr[T] = {
77
arg match {
88
case e @ '{ $x: Boolean } =>
99
e: Expr[T & Boolean]

0 commit comments

Comments
 (0)