Skip to content

Commit 31c9ebe

Browse files
Merge pull request #10467 from dotty-staging/fix-#10466
Fix #10466: Update `rootPosition` to `Position.ofMacroExpansion`
2 parents 7bdf89e + d265a86 commit 31c9ebe

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

sbt-dotty/sbt-test/sbt-dotty/tasty-inspector-example-project/app/Main.scala

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import java.nio.file.{Path, Files, Paths, FileSystems}
1010
object Main extends App {
1111

1212
val inspector = new TastyInspector {
13-
protected def processCompilationUnit(using Quotes)(root: qctx.reflect.Tree): Unit = {
14-
15-
import qctx.reflect._
13+
protected def processCompilationUnit(using Quotes)(root: quotes.reflect.Tree): Unit = {
1614
val tastyStr = root.show
1715
println(tastyStr)
1816
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ object Macro {
55
inline def f(): Unit = ${ macroImplementation }
66

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import scala.quoted._
33
object MacroRuntime {
44

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

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

+2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ $ copy-file changes/MacroRuntime.scala MacroRuntime.scala
33

44
# use an implemntation of the macro that emits a compile time error
55
$ copy-file changes/MacroRuntimeCompileError.scala MacroRuntime.scala
6+
> clean
67
-> compile
78

89
$ copy-file changes/MacroRuntime.scala MacroRuntime.scala
910
> clean
1011
> compile
1112

1213
$ copy-file changes/MacroRuntimeRuntimeError.scala MacroRuntime.scala
14+
> clean
1315
-> run

0 commit comments

Comments
 (0)