diff options
Diffstat (limited to 'test/files/run/t8601e')
-rw-r--r-- | test/files/run/t8601e/StaticInit.class | bin | 0 -> 417 bytes | |||
-rw-r--r-- | test/files/run/t8601e/StaticInit.java | 8 | ||||
-rw-r--r-- | test/files/run/t8601e/Test.scala | 12 |
3 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/t8601e/StaticInit.class b/test/files/run/t8601e/StaticInit.class Binary files differnew file mode 100644 index 0000000000..99a0e2a643 --- /dev/null +++ b/test/files/run/t8601e/StaticInit.class diff --git a/test/files/run/t8601e/StaticInit.java b/test/files/run/t8601e/StaticInit.java new file mode 100644 index 0000000000..7543ed98b8 --- /dev/null +++ b/test/files/run/t8601e/StaticInit.java @@ -0,0 +1,8 @@ +public class StaticInit { + static { + if ("".isEmpty()) { + throw new RuntimeException(); + } + } + public static int fld = 42; +} diff --git a/test/files/run/t8601e/Test.scala b/test/files/run/t8601e/Test.scala new file mode 100644 index 0000000000..838114f6a7 --- /dev/null +++ b/test/files/run/t8601e/Test.scala @@ -0,0 +1,12 @@ +class C { + def foo: Unit = {StaticInit.fld} +} + +object Test extends App { + try { + new C().foo + sys.error("StaticInit.<clinit> was not run!") + } catch { + case t: ExceptionInInitializerError => + } +} |