diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2016-10-28 22:52:16 +0200 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2016-11-22 01:35:06 +0100 |
commit | 0dc738dd1377577a4004bfe158b11bfb1fa59a9d (patch) | |
tree | 0756502d63341e2503254ca19f37693271c31220 /tests/pos-java-interop/t1254 | |
parent | 02a29c9f2127ea7b0cb0b05facd3afe8e2ec256a (diff) | |
download | dotty-0dc738dd1377577a4004bfe158b11bfb1fa59a9d.tar.gz dotty-0dc738dd1377577a4004bfe158b11bfb1fa59a9d.tar.bz2 dotty-0dc738dd1377577a4004bfe158b11bfb1fa59a9d.zip |
Fix partest compilation of java-interop tests by moving them
Previously, the tests where all in tests/pos/java-interop which means
that partest would try to run them as one single test, this failed
because some of these tests define classes with the same name. We could
fix this by putting them all in separate packages but for now it's
simple to move them to tests/pos-java-interop (they will still be run
individually as they should thanks to the `java_all` test defined in
tests.scala)
Diffstat (limited to 'tests/pos-java-interop/t1254')
-rw-r--r-- | tests/pos-java-interop/t1254/t1254.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/pos-java-interop/t1254/t1254.java b/tests/pos-java-interop/t1254/t1254.java new file mode 100644 index 000000000..17e1c60bf --- /dev/null +++ b/tests/pos-java-interop/t1254/t1254.java @@ -0,0 +1,28 @@ +/* Taken from ticket #1254. Tests Java signatures in mirror classes and that + Nothing is translated to Nothing$. +*/ + +import scala.None; + +// This compiles with javac but fails with Eclipse java compiler: +// 'The type scala.Nothing cannot be resolved. It is indirectly referenced from required .class files' +class NothingBug3 { + public NothingBug3() { + scala.Option<?> o = scala.None$.MODULE$; + + test(o); + None.toLeft(new scala.runtime.AbstractFunction0<Integer>() { + public Integer apply() { return 0; } + }); + } + + public <T>void test(scala.Option<T> f) {} +} + +// This compiles with javac but fails with Eclipse java compiler: +// 'The type scala.Nothing cannot be resolved. It is indirectly referenced from required .class files' +class NothingBug4 { + public NothingBug4() { + scala.Option o = scala.None$.MODULE$; + } +} |