[vala/0.36: 163/173] girparser: Don't accept methods as property-accessor which throw errors



commit 7b7e5e61f0f7447a74eebedc5819e23248d75d1f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jan 29 17:38:19 2018 +0100

    girparser: Don't accept methods as property-accessor which throw errors
    
    This should be considered a temporary fix.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792998

 vala/valagirparser.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 23bd4e3..15ce297 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -994,7 +994,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) {
@@ -1021,7 +1021,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 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]