aboutsummaryrefslogtreecommitdiffstats
path: root/tests/errors/ExplicitConstructorThrows.java
diff options
context:
space:
mode:
Diffstat (limited to 'tests/errors/ExplicitConstructorThrows.java')
-rw-r--r--tests/errors/ExplicitConstructorThrows.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/errors/ExplicitConstructorThrows.java b/tests/errors/ExplicitConstructorThrows.java
new file mode 100644
index 000000000..09474f703
--- /dev/null
+++ b/tests/errors/ExplicitConstructorThrows.java
@@ -0,0 +1,24 @@
+import java.io.IOException;
+
+public class ExplicitConstructorThrows extends Base { //ERR: default constructor throws IOException
+}
+
+class Base {
+ Base() throws IOException { }
+}
+
+class Sub1 extends Base {
+ Sub1() {
+ super(); //ERR: throws IOException
+ }
+}
+
+class Sub2 extends Base {
+ Sub2(String s) {
+ this(); //ERR: throws IOException
+ }
+
+ Sub2() throws IOException {
+ super();
+ }
+}