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:
Grzegorz Kossakowski 2013-02-27 17:28:07 -08:00 committed by Mark Harrah
parent d5228c592a
commit bda87c14f0
7 changed files with 20 additions and 3 deletions

View File

@ -0,0 +1 @@
object A { final val x = 1 }

View File

@ -0,0 +1 @@
object A { final val x = 2 }

View File

@ -0,0 +1,4 @@
object B
{
def main(args: Array[String]) = assert(args(0).toInt == A.x )
}

View File

@ -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

View File

@ -1 +1 @@
object A { final val x = 1 }
object A { val x = 1 }

View File

@ -1 +1 @@
object A { final val x = 2 }
object A { val x = 2 }

View File

@ -1 +1 @@
object A { def x = 3 }
object A { def x = 3 }