diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-04-24 09:11:27 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-04-24 09:14:58 +0200 |
commit | bace2691fe52c8cbb93172b0f5c0199bdd124a66 (patch) | |
tree | f6f70b076b8bca30729a7f73916ec4a329410577 /tests/errors | |
parent | f6be4cbd7f901683a1e6f4f4a0070b1e87dcce65 (diff) | |
download | vala-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.vala | 45 |
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 () { +} |