]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Don't accept methods as property-accessor which throw errors
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 29 Jan 2018 16:38:19 +0000 (17:38 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 29 Jan 2018 16:46:15 +0000 (17:46 +0100)
This should be considered a temporary fix.

https://bugzilla.gnome.org/show_bug.cgi?id=792998

vala/valagirparser.vala

index 617aaf0803df56bd5a130947d5a22da4b9cddb29..65ab2d940c0acda0bf6d9ac73d4541401faec1e3 100644 (file)
@@ -1005,7 +1005,7 @@ public class Vala.GirParser : CodeVisitor {
                                                // ensure getter vfunc if the property is abstract
                                                if (m != null) {
                                                        getter.process (parser);
-                                                       if (m.return_type is VoidType || m.get_parameters().size != 0) {
+                                                       if (m.return_type is VoidType || m.get_parameters().size != 0 || m.get_error_types ().size > 0) {
                                                                prop.set_attribute ("NoAccessorMethod", true);
                                                        } else {
                                                                if (getter.name == name) {
@@ -1032,7 +1032,7 @@ public class Vala.GirParser : CodeVisitor {
                                                // ensure setter vfunc if the property is abstract
                                                if (m != null) {
                                                        setter.process (parser);
-                                                       if (!(m.return_type is VoidType || m.return_type is BooleanType) || m.get_parameters().size != 1) {
+                                                       if (!(m.return_type is VoidType || m.return_type is BooleanType) || m.get_parameters ().size != 1 || m.get_error_types ().size > 0) {
                                                                prop.set_attribute ("NoAccessorMethod", true);
                                                                prop.set_attribute ("ConcreteAccessor", false);
                                                        } else {