diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-10-11 17:28:39 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-11-22 01:35:06 +0100 |
commit | 2d10c87ce537fb42fdb134efcae53dca7305a7b7 (patch) | |
tree | a3629c9a3ad6db3e9d07df8fa8621f8c8211076c /sbt-bridge/bridge/src/sbt-test/source-dependencies/java-static/test | |
parent | 34d64f381362b12a595fd26690c7c9b1c26d16f7 (diff) | |
download | dotty-2d10c87ce537fb42fdb134efcae53dca7305a7b7.tar.gz dotty-2d10c87ce537fb42fdb134efcae53dca7305a7b7.tar.bz2 dotty-2d10c87ce537fb42fdb134efcae53dca7305a7b7.zip |
Move sbt-bridge
Diffstat (limited to 'sbt-bridge/bridge/src/sbt-test/source-dependencies/java-static/test')
-rw-r--r-- | sbt-bridge/bridge/src/sbt-test/source-dependencies/java-static/test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sbt-bridge/bridge/src/sbt-test/source-dependencies/java-static/test b/sbt-bridge/bridge/src/sbt-test/source-dependencies/java-static/test new file mode 100644 index 000000000..42890ca74 --- /dev/null +++ b/sbt-bridge/bridge/src/sbt-test/source-dependencies/java-static/test @@ -0,0 +1,24 @@ +# When a Java class is loaded from a class file and not parsed from a source file, scalac reports +# the statics as an object without a file and so the Analyzer must know to look for the +# object's linked class. +# This test verifies this happens. +# The test compiles a Java class with a static field. +# It then adds a Scala object that references the static field. Because the object only depends on a +# static member and because the Java source is not included in the compilation (since it didn't change), +# this triggers the special case above. + +# add and compile the Java source +$ copy-file changes/J1.java src/main/java/J.java +> compile + +# add and compile the Scala source +$ copy-file changes/S.scala src/main/scala/S.scala +> compile + +# change the Java source so that a compile error should occur if S.scala is also recompiled (which will happen if the dependency was properly recorded) +$ copy-file changes/J2.java src/main/java/J.java +-> compile + +# verify it should have failed by doing a full recompilation +> clean +-> compile
\ No newline at end of file |