Skip to content

Commit 924c705

Browse files
nicolasstuckiliufengyun
authored andcommitted
Add test on incremental and suspended compilation
1 parent aa556ad commit 924c705

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import scala.quoted._
2+
3+
object Macros {
4+
5+
inline def foo: A = ${ fooImpl }
6+
7+
def fooImpl(given qctx: QuoteContext): Expr[A] = {
8+
new B().f
9+
'{ new A; }
10+
}
11+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class A
2+
3+
object Test {
4+
import Macros._
5+
6+
def main(args: Array[String]): Unit = {
7+
foo
8+
}
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class B {
2+
import Macros._
3+
4+
def f: Int = 3
5+
// def g: A = foo // comment out `g` first, then enable `g`
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class B {
2+
import Macros._
3+
4+
def f: Int = 3
5+
def g: A = foo // comment out `g` first, then enable `g`
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import sbt._
2+
import Keys._
3+
4+
object DottyInjectedPlugin extends AutoPlugin {
5+
override def requires = plugins.JvmPlugin
6+
override def trigger = allRequirements
7+
8+
override val projectSettings = Seq(
9+
scalaVersion := sys.props("plugin.scalaVersion")
10+
)
11+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version"))
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
> compile
2+
3+
# make sure that Macros is recompiled due to it's dependencie on B.f
4+
# this will end in a failure to compile due to cyclic macros
5+
$ copy-file changes/TestB.scala TestB.scala
6+
-> compile

0 commit comments

Comments
 (0)