diff options
author | Michael James Gratton <mike@vee.net> | 2017-02-06 16:47:21 +1100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2017-02-08 11:23:28 +0100 |
commit | c73d19cc1d9919dcdf992fe0263f108c86dd328a (patch) | |
tree | 69746eebb0a66ab6b7a75474fcd0cca5d1072c2e /tests/errors | |
parent | 6b275cf3adcdae1b91054586435d10c99d13c0ef (diff) | |
download | vala-c73d19cc1d9919dcdf992fe0263f108c86dd328a.tar.gz |
codegen: Don't return void for non-nullable simple-type structs
https://bugzilla.gnome.org/show_bug.cgi?id=778224
Diffstat (limited to 'tests/errors')
-rw-r--r-- | tests/errors/bug778224.vala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/errors/bug778224.vala b/tests/errors/bug778224.vala new file mode 100644 index 000000000..3a61a029b --- /dev/null +++ b/tests/errors/bug778224.vala @@ -0,0 +1,26 @@ +errordomain FooError { + BAR; +} + +[SimpleType] +struct Foo { + int i; +} + +bool @true = true; + +Foo foo () throws FooError { + if (@true) { + throw new FooError.BAR (""); + } + + return { 1 }; +} + +void main () { + try { + foo (); + } catch { + } +} + |