]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Do not allow default values for ref parameters
authorJürg Billeter <j@bitron.ch>
Thu, 23 Dec 2010 10:35:04 +0000 (11:35 +0100)
committerJürg Billeter <j@bitron.ch>
Thu, 23 Dec 2010 10:39:37 +0000 (11:39 +0100)
vala/valaparameter.vala

index aea16ef38ad5646eb5d78a5222449da434a15951..7c52e9c683587f90c4ce876b7dd92c86c93cc788 100644 (file)
@@ -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");
                        }
                }