Skip to content

Commit 9b3fea1

Browse files
Merge pull request #9315 from dotty-staging/remove-QuoteContext-reporting-conversion
Remove QuoteContext reporting implicit conversion
2 parents be1327f + 94ea810 commit 9b3fea1

File tree

9 files changed

+12
-18
lines changed

9 files changed

+12
-18
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,3 @@ trait QuoteContext { self =>
3535
}
3636

3737
}
38-
39-
object QuoteContext {
40-
// TODO remove in 0.26.0
41-
@deprecated("Errors and warnings have been moved to scala.quoted.Reporting", "0.25.0")
42-
given error_and_warining_on_QuoteContext as Conversion[QuoteContext, Reporting.type] = _ => Reporting
43-
}

tests/neg-macros/BigFloat/BigFloatFromDigitsImpl_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import scala.util.FromDigits
33
import scala.quoted._
44

55
object BigFloatFromDigitsImpl:
6-
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[BigFloat] =
6+
def apply(digits: Expr[String])(using QuoteContext): Expr[BigFloat] =
77
digits match
88
case Const(ds) =>
99
try
1010
val BigFloat(m, e) = BigFloat(ds)
1111
'{BigFloat(${Expr(m)}, ${Expr(e)})}
1212
catch case ex: FromDigits.FromDigitsException =>
13-
ctx.error(ex.getMessage)
13+
Reporting.error(ex.getMessage)
1414
'{BigFloat(0, 0)}
1515
case digits =>
1616
'{BigFloat($digits)}

tests/neg-macros/GenericNumLits/EvenFromDigitsImpl_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import scala.quoted._
33
import Even._
44

55
object EvenFromDigitsImpl:
6-
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[Even] = digits match {
6+
def apply(digits: Expr[String])(using QuoteContext): Expr[Even] = digits match {
77
case Const(ds) =>
88
val ev =
99
try evenFromDigits(ds)
1010
catch {
1111
case ex: FromDigits.FromDigitsException =>
12-
ctx.error(ex.getMessage)
12+
Reporting.error(ex.getMessage)
1313
Even(0)
1414
}
1515
'{Even(${Expr(ev.n)})}

tests/neg-macros/i9014/Macros_1.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
import scala.quoted._
22
trait Bar
33
inline given as Bar = ${ impl }
4-
def impl(using qctx: QuoteContext): Expr[Bar] = qctx.throwError("Failed to expand!")
4+
def impl(using qctx: QuoteContext): Expr[Bar] = Reporting.throwError("Failed to expand!")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import scala.quoted._
33
import Even._
44

55
object EvenFromDigitsImpl:
6-
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[Even] = digits match {
6+
def apply(digits: Expr[String])(using QuoteContext): Expr[Even] = digits match {
77
case Const(ds) =>
88
val ev =
99
try evenFromDigits(ds)
1010
catch {
1111
case ex: FromDigits.FromDigitsException =>
12-
ctx.error(ex.getMessage)
12+
Reporting.error(ex.getMessage)
1313
Even(0)
1414
}
1515
'{Even(${Expr(ev.n)})}

tests/run-macros/BigFloat/BigFloatFromDigitsImpl_1.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import scala.util.FromDigits
33
import scala.quoted._
44

55
object BigFloatFromDigitsImpl:
6-
def apply(digits: Expr[String])(using ctx: QuoteContext): Expr[BigFloat] =
6+
def apply(digits: Expr[String])(using QuoteContext): Expr[BigFloat] =
77
digits match
88
case Const(ds) =>
99
try
1010
val BigFloat(m, e) = BigFloat(ds)
1111
'{BigFloat(${Expr(m)}, ${Expr(e)})}
1212
catch case ex: FromDigits.FromDigitsException =>
13-
ctx.error(ex.getMessage)
13+
Reporting.error(ex.getMessage)
1414
'{BigFloat(0, 0)}
1515
case digits =>
1616
'{BigFloat($digits)}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ object Macros {
6666
case FromEnv(expr) => expr.asInstanceOf[Expr[R[T]]]
6767

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

7272
})

0 commit comments

Comments
 (0)