]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gidlparser: Do not set nullable to void type
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 20 Mar 2014 21:24:27 +0000 (22:24 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Thu, 20 Mar 2014 21:27:05 +0000 (22:27 +0100)
vapigen/valagidlparser.vala

index a5fc598c260e32f1a8885b84400d048881d8b727..ee9f76ad0d00d7bc8cc77d2e62483adbd89eb970 100644 (file)
@@ -2257,7 +2257,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                                m.set_attribute ("DestroysInstance", true, m.source_reference);
                                        }
                                } else if (nv[0] == "nullable") {
-                                       if (eval (nv[1]) == "1") {
+                                       if (eval (nv[1]) == "1" && !(return_type is VoidType)) {
                                                return_type.nullable = true;
                                        }
                                } else if (nv[0] == "sentinel") {
@@ -2447,7 +2447,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                                        }
                                                }
                                        } else if (nv[0] == "nullable") {
-                                               if (eval (nv[1]) == "1") {
+                                               if (eval (nv[1]) == "1" && !(param_type is VoidType)) {
                                                        param_type.nullable = true;
                                                }
                                        } else if (nv[0] == "transfer_ownership") {
@@ -2732,7 +2732,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                                prop.set_attribute ("Experimental", true);
                                        }
                                } else if (nv[0] == "nullable") {
-                                       if (eval (nv[1]) == "1") {
+                                       if (eval (nv[1]) == "1" && !(prop.property_type is VoidType)) {
                                                prop.property_type.nullable = true;
                                        }
                                } else if (nv[0] == "abstract") {
@@ -3120,7 +3120,7 @@ public class Vala.GIdlParser : CodeVisitor {
                                                        p.direction = ParameterDirection.REF;
                                                }
                                        } else if (nv[0] == "nullable") {
-                                               if (eval (nv[1]) == "1") {
+                                               if (eval (nv[1]) == "1" && !(param_type is VoidType)) {
                                                        param_type.nullable = true;
                                                }
                                        } else if (nv[0] == "transfer_ownership") {