diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-04-01 14:05:31 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2016-04-01 14:05:31 +0200 |
commit | 19dac8212090f81ffd18bad6d7cc929fbff9bec8 (patch) | |
tree | 37943111ae925d9fdd092073a336cff3f6a38e98 /test/files | |
parent | ad361859546aaa84349714c0a5890492fec38939 (diff) | |
parent | 6181525f60588228ce99ab3ef2593ecfcfd35066 (diff) | |
download | scala-19dac8212090f81ffd18bad6d7cc929fbff9bec8.tar.gz scala-19dac8212090f81ffd18bad6d7cc929fbff9bec8.tar.bz2 scala-19dac8212090f81ffd18bad6d7cc929fbff9bec8.zip |
Merge pull request #5068 from retronym/topic/jdk8ism2v2.12.0-M4
Accomodate and exploit new library, lang features JDK 8
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/java-type-annotations/NotNull.java | 6 | ||||
-rw-r--r-- | test/files/pos/java-type-annotations/Test.java | 4 | ||||
-rw-r--r-- | test/files/run/t5375.check | 1 | ||||
-rw-r--r-- | test/files/run/t5375.scala | 16 |
4 files changed, 22 insertions, 5 deletions
diff --git a/test/files/pos/java-type-annotations/NotNull.java b/test/files/pos/java-type-annotations/NotNull.java new file mode 100644 index 0000000000..2716fe1a99 --- /dev/null +++ b/test/files/pos/java-type-annotations/NotNull.java @@ -0,0 +1,6 @@ +import java.lang.annotation.*; + +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) +public @interface NotNull { +} diff --git a/test/files/pos/java-type-annotations/Test.java b/test/files/pos/java-type-annotations/Test.java new file mode 100644 index 0000000000..d6bda1dedb --- /dev/null +++ b/test/files/pos/java-type-annotations/Test.java @@ -0,0 +1,4 @@ +public class Test { + static class C<@NotNull T> {}; + @NotNull String foo() { return ""; } +} diff --git a/test/files/run/t5375.check b/test/files/run/t5375.check index b1a57eeeec..e69de29bb2 100644 --- a/test/files/run/t5375.check +++ b/test/files/run/t5375.check @@ -1 +0,0 @@ -Runtime exception diff --git a/test/files/run/t5375.scala b/test/files/run/t5375.scala index 826ecd841e..2028b6f05d 100644 --- a/test/files/run/t5375.scala +++ b/test/files/run/t5375.scala @@ -1,8 +1,16 @@ object Test extends App { val foos = (1 to 1000).toSeq - try - foos.par.map(i => if (i % 37 == 0) sys.error("i div 37") else i) - catch { - case ex: RuntimeException => println("Runtime exception") + try { + foos.par.map(i => if (i % 37 == 0) throw new MultipleOf37Exception(i) else i) + assert(false) + } catch { + case ex: MultipleOf37Exception => + assert(ex.getSuppressed.size > 0) + assert(ex.getSuppressed.forall(_.isInstanceOf[MultipleOf37Exception])) + assert(ex.i == 37) + assert(ex.getSuppressed.map(_.asInstanceOf[MultipleOf37Exception].i).toList == List(74, 148, 259, 518)) + case _: Throwable => + assert(false) } + class MultipleOf37Exception(val i: Int) extends RuntimeException } |