Skip to content

Commit 7bc4e0f

Browse files
committed
Fix source-dependencies/macro-expansion-dependencies-2
In 80ed86a we removed some explicit parameter names which made incremental compilation behave diferently than what the original test expected. At some point, the macro implementation failed to compile which regiseted as a success for `-> compile`. Now we test that the macros compile before testing the error that they emit.
1 parent cbc682f commit 7bc4e0f

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

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
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
object MacroRuntime {
44

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import scala.quoted._
22

33
object MacroRuntime {
44

5-
def impl()(using Quotes): Expr[Unit] = {
5+
def impl()(using q: Quotes): Expr[Unit] = {
66
'{ ??? }
77
}
88

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

414
# use an implemntation of the macro that emits a compile time error
515
$ copy-file changes/MacroRuntimeCompileError.scala MacroRuntime.scala
6-
> clean
716
-> compile
817

918
$ copy-file changes/MacroRuntime.scala MacroRuntime.scala
1019
> clean
1120
> compile
1221

1322
$ copy-file changes/MacroRuntimeRuntimeError.scala MacroRuntime.scala
14-
> clean
1523
-> run

0 commit comments

Comments
 (0)