Skip to content

Commit

Permalink
Fix scala#6452: capture plugin ordering conflict with a pos projct
Browse files Browse the repository at this point in the history
  • Loading branch information
liufengyun committed May 4, 2019
1 parent 61ea245 commit 8c1344d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package hello

object Hello {
def main(args: Array[String]): Unit = {
val dotty: Int | String = "dotty"
println(s"Hello $dotty!")
}
}
6 changes: 6 additions & 0 deletions sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ lazy val app = project
.settings(
scalaVersion := dottyVersion
)

lazy val appOk = project
.in(file("appOk"))
.settings(
scalaVersion := dottyVersion
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@ lazy val app = project
scalaVersion := dottyVersion,
addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
)

lazy val appOk = project
.in(file("appOk"))
.settings(
scalaVersion := dottyVersion,
addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class DivideZero extends PluginPhase with StandardPlugin {

val phaseName = name

override val runsAfter = Set(Pickler.name)
override val runsBefore = Set(Staging.name)
override val runsAfter = Set(Staging.name)
override val runsBefore = Set(Pickler.name)

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

Expand Down
4 changes: 4 additions & 0 deletions sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/test
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
$ copy-file changes/build.sbt build.sbt
> reload

# Should compile with the plugin
> clean
> appOk/compile

# Should NOT compile with the plugin
> clean
-> app/compile

0 comments on commit 8c1344d

Please sign in to comment.