diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2010-10-20 13:26:11 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2010-10-20 13:26:11 +0000 |
commit | 2014160121a62681bdc0e873a3f7e9b5e3bbae16 (patch) | |
tree | 5da2d4ad44f798bbf210f583139b302390ff8c8e /test/files | |
parent | add9be644fd7b2864e4dcdd792980622622c934a (diff) | |
download | scala-2014160121a62681bdc0e873a3f7e9b5e3bbae16.tar.gz scala-2014160121a62681bdc0e873a3f7e9b5e3bbae16.tar.bz2 scala-2014160121a62681bdc0e873a3f7e9b5e3bbae16.zip |
Closes #3059, #3895 (the only difference betwee...
Closes #3059, #3895 (the only difference between this and r23232 is the
forced info transformation that ensures that nested objects are viewed
as lazy vals). sbt integration requires new starr for this commit to
work.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/buildmanager/t3059/A.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t3059/B.scala | 4 | ||||
-rw-r--r-- | test/files/buildmanager/t3059/t3059.check | 6 | ||||
-rw-r--r-- | test/files/buildmanager/t3059/t3059.test | 2 | ||||
-rw-r--r-- | test/files/run/t3895.check | 2 | ||||
-rw-r--r-- | test/files/run/t3895.flags | 1 | ||||
-rw-r--r-- | test/files/run/t3895.scala | 30 | ||||
-rw-r--r-- | test/files/run/t3895b.scala | 30 |
8 files changed, 79 insertions, 0 deletions
diff --git a/test/files/buildmanager/t3059/A.scala b/test/files/buildmanager/t3059/A.scala new file mode 100644 index 0000000000..0dd25f6647 --- /dev/null +++ b/test/files/buildmanager/t3059/A.scala @@ -0,0 +1,4 @@ +class A extends B { + private def getBar = List(1,2,3) + lazy val bar: List[Int] = getBar +} diff --git a/test/files/buildmanager/t3059/B.scala b/test/files/buildmanager/t3059/B.scala new file mode 100644 index 0000000000..46596870ac --- /dev/null +++ b/test/files/buildmanager/t3059/B.scala @@ -0,0 +1,4 @@ +abstract class B { + private def getFoo = 12 + lazy val foo: Int = getFoo +} diff --git a/test/files/buildmanager/t3059/t3059.check b/test/files/buildmanager/t3059/t3059.check new file mode 100644 index 0000000000..4a8076aae1 --- /dev/null +++ b/test/files/buildmanager/t3059/t3059.check @@ -0,0 +1,6 @@ +builder > A.scala B.scala +compiling Set(A.scala, B.scala) +Changes: Map() +builder > A.scala +compiling Set(A.scala) +Changes: Map(class A -> List())
\ No newline at end of file diff --git a/test/files/buildmanager/t3059/t3059.test b/test/files/buildmanager/t3059/t3059.test new file mode 100644 index 0000000000..6f3749dc4b --- /dev/null +++ b/test/files/buildmanager/t3059/t3059.test @@ -0,0 +1,2 @@ +>>compile A.scala B.scala +>>compile A.scala
\ No newline at end of file diff --git a/test/files/run/t3895.check b/test/files/run/t3895.check new file mode 100644 index 0000000000..3045ebf016 --- /dev/null +++ b/test/files/run/t3895.check @@ -0,0 +1,2 @@ +17 +17
\ No newline at end of file diff --git a/test/files/run/t3895.flags b/test/files/run/t3895.flags new file mode 100644 index 0000000000..ae08446055 --- /dev/null +++ b/test/files/run/t3895.flags @@ -0,0 +1 @@ +-Xcheckinit
\ No newline at end of file diff --git a/test/files/run/t3895.scala b/test/files/run/t3895.scala new file mode 100644 index 0000000000..dfc4a34a32 --- /dev/null +++ b/test/files/run/t3895.scala @@ -0,0 +1,30 @@ +class C extends A{ + + val a = 10 + //object bb + lazy val bb = 17 + val b = 12 +} + +abstract class A{ + val a: Int + val b: Int + val c: Int = 12 +} + +class B extends A{ + + val a = 10 + //object bb + lazy val bb = 17 + val b = 12 +} + + +object Test { + def main(args: Array[String]) { + println(new B().bb) + println(new C().bb) + } +} + diff --git a/test/files/run/t3895b.scala b/test/files/run/t3895b.scala new file mode 100644 index 0000000000..fd74aab125 --- /dev/null +++ b/test/files/run/t3895b.scala @@ -0,0 +1,30 @@ +class DryRun +{ + import scala.tools.nsc.{Global, Settings, CompilerCommand} + import scala.tools.nsc.reporters.ConsoleReporter + + val settings = new Settings() + settings.classpath.value = System.getProperty("java.class.path") + val command = new CompilerCommand(List(), settings) + val reporter = new ConsoleReporter(settings, scala.Console.in, new java.io.PrintWriter(new java.io.PrintStream(scala.Console.out))) + object compiler extends Global(command.settings, reporter) + { + object test1 + lazy val test2 = 1 + object test3 + + } + def test { + compiler.test1 + compiler.test2 + compiler.test3 + val run = new compiler.Run + run compile command.files + } +} + +object Test { + def main(args: Array[String]) { + new DryRun().test + } +} |