From: Luca Bruno Date: Mon, 20 Dec 2010 12:17:00 +0000 (+0100) Subject: Only allow null default value for out parameters X-Git-Tag: 0.11.3~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=645b7ce16d84055601f5a519f2ca538029299fff;p=thirdparty%2Fvala.git Only allow null default value for out parameters Fixes bug 636096. --- diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index d73e25c6e..aea16ef38 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -262,6 +262,8 @@ public class Vala.Parameter : Variable { && !variable_type.nullable && direction != ParameterDirection.OUT) { Report.warning (source_reference, "`null' incompatible with parameter type `%s`".printf (variable_type.to_string ())); + } else if (!(initializer is NullLiteral) && direction == ParameterDirection.OUT) { + Report.error (source_reference, "only `null' is allowed as default value for out parameters"); } }