]> 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 22:04:27 +0000 (23:04 +0100)
This should be considered a temporary fix.

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

vala/valagirparser.vala

index 387db6027b1d0c0a39817968f87658bef0adb008..140456c9df4eeab4685fa1a9d14f35218cedca28 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 {