From: Luca Bruno Date: Thu, 20 Mar 2014 21:24:27 +0000 (+0100) Subject: gidlparser: Do not set nullable to void type X-Git-Tag: 0.24.0~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1324f492737c27552a28d0d911e74064cdfa75b;p=thirdparty%2Fvala.git gidlparser: Do not set nullable to void type --- diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index a5fc598c2..ee9f76ad0 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -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") {