From: Jürg Billeter Date: Thu, 23 Dec 2010 10:35:04 +0000 (+0100) Subject: Do not allow default values for ref parameters X-Git-Tag: 0.11.3~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa45974389f64eef60205c72272bb0f4a1dcde35;p=thirdparty%2Fvala.git Do not allow default values for ref parameters --- diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala index aea16ef38..7c52e9c68 100644 --- a/vala/valaparameter.vala +++ b/vala/valaparameter.vala @@ -264,6 +264,8 @@ public class Vala.Parameter : Variable { 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"); + } else if (direction == ParameterDirection.REF) { + Report.error (source_reference, "default value not allowed for ref parameter"); } }