diff --git a/docs/docs/reference/metaprogramming/macros.md b/docs/docs/reference/metaprogramming/macros.md index d1ac99d7f2a8..2d5713d30926 100644 --- a/docs/docs/reference/metaprogramming/macros.md +++ b/docs/docs/reference/metaprogramming/macros.md @@ -723,14 +723,14 @@ private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using case '{ $arg: t } => Expr.summon[Show[t]] match { case Some(showExpr) => '{ $showExpr.show($arg) } - case None => Reporting.error(s"could not find implicit for ${showTp.show}", arg); '{???} + case None => report.error(s"could not find implicit for ${showTp.show}", arg); '{???} } } val newArgsExpr = Varargs(argShowedExprs) '{ $sc.s($newArgsExpr: _*) } case _ => // `new StringContext(...).showMeExpr(args: _*)` not an explicit `showMeExpr"..."` - Reporting.error(s"Args must be explicit", argsExpr) + report.error(s"Args must be explicit", argsExpr) '{???} } } diff --git a/docs/docs/reference/metaprogramming/tasty-reflect.md b/docs/docs/reference/metaprogramming/tasty-reflect.md index 7d93daff9b3d..3c351585bcba 100644 --- a/docs/docs/reference/metaprogramming/tasty-reflect.md +++ b/docs/docs/reference/metaprogramming/tasty-reflect.md @@ -46,13 +46,13 @@ def natConstImpl(x: Expr[Int])(using Quotes): Expr[Int] = { xTree match { case Inlined(_, _, Literal(Constant(n: Int))) => if (n <= 0) { - Reporting.error("Parameter must be natural number") + report.error("Parameter must be natural number") '{0} } else { xTree.asExprOf[Int] } case _ => - Reporting.error("Parameter must be a known constant") + report.error("Parameter must be a known constant") '{0} } } diff --git a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/MacroCompileError.scala b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/MacroCompileError.scala index 311c27cc4c56..47c29c242ac3 100644 --- a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/MacroCompileError.scala +++ b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/MacroCompileError.scala @@ -6,7 +6,7 @@ object Macro { def macroImplementation(using Quotes): Expr[Unit] = { import quotes.reflect._ - Reporting.error("some error", Position.ofMacroExpansion) + report.error("some error", Position.ofMacroExpansion) '{ println("Implementation in MacroCompileError") } } diff --git a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/Main.scala b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/Main.scala similarity index 100% rename from sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/Main.scala rename to sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/Main.scala diff --git a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test index 45a1c3f4fb8f..092c454ec03f 100644 --- a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test +++ b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/test @@ -1,4 +1,14 @@ +$ copy-file changes/MacroCompileError.scala Macro.scala +> clean +> compile + +$ copy-file changes/MacroRuntimeError.scala Macro.scala +> clean +> compile + +$ copy-file changes/Main.scala Main.scala $ copy-file changes/Macro.scala Macro.scala +> clean > run # use an implemntation of the macro that emits a compile time error diff --git a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-2/changes/MacroRuntimeCompileError.scala b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-2/changes/MacroRuntimeCompileError.scala index 2d2e2b52d00d..e2e7f13bfb94 100644 --- a/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-2/changes/MacroRuntimeCompileError.scala +++ b/sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-2/changes/MacroRuntimeCompileError.scala @@ -4,7 +4,7 @@ object MacroRuntime { def impl()(using q: Quotes): Expr[Unit] = { import quotes.reflect._ - Reporting.error("some error", Position.ofMacroExpansion) + report.error("some error", Position.ofMacroExpansion) '{ println("Implementation in MacroCompileError") } }