Skip to content

Commit a3fcb15

Browse files
Merge pull request #10524 from dotty-staging/fix-#10466-2
Fix #10466: Update reporting API
2 parents 55fdd99 + f64591f commit a3fcb15

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,14 +723,14 @@ private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using
723723
case '{ $arg: t } =>
724724
Expr.summon[Show[t]] match {
725725
case Some(showExpr) => '{ $showExpr.show($arg) }
726-
case None => Reporting.error(s"could not find implicit for ${showTp.show}", arg); '{???}
726+
case None => report.error(s"could not find implicit for ${showTp.show}", arg); '{???}
727727
}
728728
}
729729
val newArgsExpr = Varargs(argShowedExprs)
730730
'{ $sc.s($newArgsExpr: _*) }
731731
case _ =>
732732
// `new StringContext(...).showMeExpr(args: _*)` not an explicit `showMeExpr"..."`
733-
Reporting.error(s"Args must be explicit", argsExpr)
733+
report.error(s"Args must be explicit", argsExpr)
734734
'{???}
735735
}
736736
}

docs/docs/reference/metaprogramming/tasty-reflect.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ def natConstImpl(x: Expr[Int])(using Quotes): Expr[Int] = {
4646
xTree match {
4747
case Inlined(_, _, Literal(Constant(n: Int))) =>
4848
if (n <= 0) {
49-
Reporting.error("Parameter must be natural number")
49+
report.error("Parameter must be natural number")
5050
'{0}
5151
} else {
5252
xTree.asExprOf[Int]
5353
}
5454
case _ =>
55-
Reporting.error("Parameter must be a known constant")
55+
report.error("Parameter must be a known constant")
5656
'{0}
5757
}
5858
}

sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/MacroCompileError.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ object Macro {
66

77
def macroImplementation(using Quotes): Expr[Unit] = {
88
import quotes.reflect._
9-
Reporting.error("some error", Position.ofMacroExpansion)
9+
report.error("some error", Position.ofMacroExpansion)
1010
'{ println("Implementation in MacroCompileError") }
1111
}
1212

sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1+
$ copy-file changes/MacroCompileError.scala Macro.scala
2+
> clean
3+
> compile
4+
5+
$ copy-file changes/MacroRuntimeError.scala Macro.scala
6+
> clean
7+
> compile
8+
9+
$ copy-file changes/Main.scala Main.scala
110
$ copy-file changes/Macro.scala Macro.scala
11+
> clean
212
> run
313

414
# use an implemntation of the macro that emits a compile time error

sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-2/changes/MacroRuntimeCompileError.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object MacroRuntime {
44

55
def impl()(using q: Quotes): Expr[Unit] = {
66
import quotes.reflect._
7-
Reporting.error("some error", Position.ofMacroExpansion)
7+
report.error("some error", Position.ofMacroExpansion)
88
'{ println("Implementation in MacroCompileError") }
99
}
1010

0 commit comments

Comments
 (0)