mirror of https://github.com/sbt/sbt.git
Compile-time constant dependency tracking moved to separate test.
The `final` modifier is not essential in `source-dependencies/export-jars` and removing it eliminates the danger of running into Scala's bug SI-7173 where typer inlines constants and does not record any information about dependency. In case we want to switch to dependency tracking based on trees we would run into this problem in this test-case. Testing for that scenario has been moved to separate test case `source-dependencies/constants`.
This commit is contained in:
parent
d5228c592a
commit
bda87c14f0
|
|
@ -0,0 +1 @@
|
|||
object A { final val x = 1 }
|
||||
|
|
@ -0,0 +1 @@
|
|||
object A { final val x = 2 }
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
object B
|
||||
{
|
||||
def main(args: Array[String]) = assert(args(0).toInt == A.x )
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
# Tests if source dependencies are tracked properly
|
||||
# for compile-time constants (like final vals in top-level objects)
|
||||
# see https://issues.scala-lang.org/browse/SI-7173 for details
|
||||
# why compile-time constants can be tricky to track due to early inlining
|
||||
|
||||
$ copy-file changes/B.scala B.scala
|
||||
|
||||
$ copy-file changes/A1.scala A.scala
|
||||
> run 1
|
||||
$ copy-file changes/A2.scala A.scala
|
||||
> run 2
|
||||
|
|
@ -1 +1 @@
|
|||
object A { final val x = 1 }
|
||||
object A { val x = 1 }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
object A { final val x = 2 }
|
||||
object A { val x = 2 }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
object A { def x = 3 }
|
||||
object A { def x = 3 }
|
||||
|
|
|
|||
Loading…
Reference in New Issue