Skip to content

Commit 6429f7c

Browse files
authored
Merge pull request #6453 from dotty-staging/fix-6452
Fix #6452: capture plugin ordering conflict with a pos project
2 parents 360dcad + 8c1344d commit 6429f7c

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package hello
2+
3+
object Hello {
4+
def main(args: Array[String]): Unit = {
5+
val dotty: Int | String = "dotty"
6+
println(s"Hello $dotty!")
7+
}
8+
}

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ lazy val app = project
2222
.settings(
2323
scalaVersion := dottyVersion
2424
)
25+
26+
lazy val appOk = project
27+
.in(file("appOk"))
28+
.settings(
29+
scalaVersion := dottyVersion
30+
)

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,10 @@ lazy val app = project
1919
scalaVersion := dottyVersion,
2020
addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
2121
)
22+
23+
lazy val appOk = project
24+
.in(file("appOk"))
25+
.settings(
26+
scalaVersion := dottyVersion,
27+
addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
28+
)

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/plugin/DivideZero.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ class DivideZero extends PluginPhase with StandardPlugin {
1919

2020
val phaseName = name
2121

22-
override val runsAfter = Set(Pickler.name)
23-
override val runsBefore = Set(Staging.name)
22+
override val runsAfter = Set(Staging.name)
23+
override val runsBefore = Set(Pickler.name)
2424

2525
def init(options: List[String]): List[PluginPhase] = this :: Nil
2626

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
$ copy-file changes/build.sbt build.sbt
99
> reload
1010

11+
# Should compile with the plugin
12+
> clean
13+
> appOk/compile
14+
1115
# Should NOT compile with the plugin
1216
> clean
1317
-> app/compile

0 commit comments

Comments
 (0)