summaryrefslogtreecommitdiff
path: root/tests/errors
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-04-24 09:11:27 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2021-04-24 09:14:58 +0200
commitbace2691fe52c8cbb93172b0f5c0199bdd124a66 (patch)
treef6f70b076b8bca30729a7f73916ec4a329410577 /tests/errors
parentf6be4cbd7f901683a1e6f4f4a0070b1e87dcce65 (diff)
downloadvala-bace2691fe52c8cbb93172b0f5c0199bdd124a66.tar.gz
vala: Report a warning for unhandled errors in destructors
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1176
Diffstat (limited to 'tests/errors')
-rw-r--r--tests/errors/unhandled.vala45
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/errors/unhandled.vala b/tests/errors/unhandled.vala
new file mode 100644
index 000000000..1a3768a6c
--- /dev/null
+++ b/tests/errors/unhandled.vala
@@ -0,0 +1,45 @@
+public errordomain FooError {
+ FAIL
+}
+
+public class Foo : Object {
+ public string bar {
+ get {
+ throw new FooError.FAIL ("property getter");
+ }
+ set {
+ throw new FooError.FAIL ("property setter");
+ }
+ }
+
+ public Foo () {
+ throw new FooError.FAIL ("creation method");
+ }
+
+ construct {
+ throw new FooError.FAIL ("constructor");
+ }
+
+ class construct {
+ throw new FooError.FAIL ("class constructor");
+ }
+
+ static construct {
+ throw new FooError.FAIL ("static constructor");
+ }
+
+ ~Foo () {
+ throw new FooError.FAIL ("destructor");
+ }
+
+ class ~Foo () {
+ throw new FooError.FAIL ("class destructor");
+ }
+
+ public void foo () {
+ throw new FooError.FAIL ("method");
+ }
+}
+
+void main () {
+}