Skip to content

Remove QuoteContext reporting implicit conversion #9315

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
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-bootstrapped/scala/quoted/QuoteContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,3 @@ trait QuoteContext { self =>
}

}

object QuoteContext {
// TODO remove in 0.26.0
@deprecated("Errors and warnings have been moved to scala.quoted.Reporting", "0.25.0")
given error_and_warining_on_QuoteContext as Conversion[QuoteContext, Reporting.type] = _ => Reporting
}
4 changes: 2 additions & 2 deletions tests/neg-macros/BigFloat/BigFloatFromDigitsImpl_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import scala.util.FromDigits
import scala.quoted._

object BigFloatFromDigitsImpl:
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[BigFloat] =
def apply(digits: Expr[String])(using QuoteContext): Expr[BigFloat] =
digits match
case Const(ds) =>
try
val BigFloat(m, e) = BigFloat(ds)
'{BigFloat(${Expr(m)}, ${Expr(e)})}
catch case ex: FromDigits.FromDigitsException =>
ctx.error(ex.getMessage)
Reporting.error(ex.getMessage)
'{BigFloat(0, 0)}
case digits =>
'{BigFloat($digits)}
4 changes: 2 additions & 2 deletions tests/neg-macros/GenericNumLits/EvenFromDigitsImpl_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import scala.quoted._
import Even._

object EvenFromDigitsImpl:
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[Even] = digits match {
def apply(digits: Expr[String])(using QuoteContext): Expr[Even] = digits match {
case Const(ds) =>
val ev =
try evenFromDigits(ds)
catch {
case ex: FromDigits.FromDigitsException =>
ctx.error(ex.getMessage)
Reporting.error(ex.getMessage)
Even(0)
}
'{Even(${Expr(ev.n)})}
Expand Down
2 changes: 1 addition & 1 deletion tests/neg-macros/i9014/Macros_1.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import scala.quoted._
trait Bar
inline given as Bar = ${ impl }
def impl(using qctx: QuoteContext): Expr[Bar] = qctx.throwError("Failed to expand!")
def impl(using qctx: QuoteContext): Expr[Bar] = Reporting.throwError("Failed to expand!")
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import scala.quoted._
import Even._

object EvenFromDigitsImpl:
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[Even] = digits match {
def apply(digits: Expr[String])(using QuoteContext): Expr[Even] = digits match {
case Const(ds) =>
val ev =
try evenFromDigits(ds)
catch {
case ex: FromDigits.FromDigitsException =>
ctx.error(ex.getMessage)
Reporting.error(ex.getMessage)
Even(0)
}
'{Even(${Expr(ev.n)})}
Expand Down
4 changes: 2 additions & 2 deletions tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import scala.util.FromDigits
import scala.quoted._

object BigFloatFromDigitsImpl:
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[BigFloat] =
def apply(digits: Expr[String])(using QuoteContext): Expr[BigFloat] =
digits match
case Const(ds) =>
try
val BigFloat(m, e) = BigFloat(ds)
'{BigFloat(${Expr(m)}, ${Expr(e)})}
catch case ex: FromDigits.FromDigitsException =>
ctx.error(ex.getMessage)
Reporting.error(ex.getMessage)
'{BigFloat(0, 0)}
case digits =>
'{BigFloat($digits)}
2 changes: 1 addition & 1 deletion tests/run-macros/quote-matcher-symantics-3/quoted_1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ object Macros {
case FromEnv(expr) => expr.asInstanceOf[Expr[R[T]]]

case _ =>
summon[QuoteContext].error("Expected explicit value but got: " + e.show, e)
Reporting.error("Expected explicit value but got: " + e.show, e)
'{ ??? }

})
Expand Down