Skip to content

Remove useless implicit #6841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions library/src/scala/quoted/QuoteContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,5 @@ class QuoteContext(val tasty: scala.tasty.Reflection) {
}

object QuoteContext {
// TODO remove in 0.18
// For backward compat with macros
@deprecated("Provide scala.quoted.QuoteContext instead of using a scala.tasty.Reflection", "0.17")
implicit def reflectionToQuoteContext(implicit reflect: tasty.Reflection): scala.quoted.QuoteContext =
new scala.quoted.QuoteContext(reflect)

def macroContext: QuoteContext = throw new Exception("Not in inline macro.")
}
3 changes: 2 additions & 1 deletion tests/neg/quotedPatterns-5.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import scala.quoted._
object Test {
def test(x: quoted.Expr[Int]) given tasty.Reflection = x match {
def test(x: quoted.Expr[Int]) given QuoteContext = x match {
case '{ type $t; poly[$t]($x); 4 } => ??? // error: duplicate pattern variable: $t
case '{ type `$t`; poly[`$t`]($x); 4 } =>
val tt: quoted.Type[_] = t // error
Expand Down
2 changes: 1 addition & 1 deletion tests/pos/quote-matching-implicit-types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import scala.quoted._

object Foo {

def f(e: Expr[Any]) given tasty.Reflection : Unit = e match {
def f(e: Expr[Any]) given QuoteContext: Unit = e match {
case '{ foo[$t]($x) } => bar(x)
case '{ foo[$t]($x) } if bar(x) => ()
case '{ foo[$t]($x) } => '{ foo($x) }
Expand Down
2 changes: 1 addition & 1 deletion tests/pos/quoted-pattern-type.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import scala.tasty.Reflection

object Lib {

def impl[T: Type](arg: Expr[T])(implicit refl: Reflection): Expr[T] = {
def impl[T: Type](arg: Expr[T]) given QuoteContext: Expr[T] = {
arg match {
case e @ '{ $x: Boolean } =>
e: Expr[T & Boolean]
Expand Down