summaryrefslogtreecommitdiff
path: root/test/files/run/t8601e/Test.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t8601e/Test.scala')
-rw-r--r--test/files/run/t8601e/Test.scala12
1 files changed, 12 insertions, 0 deletions
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 =>
+ }
+}