[vala] Do not allow default values for ref parameters



commit fa45974389f64eef60205c72272bb0f4a1dcde35
Author: Jürg Billeter <j bitron ch>
Date:   Thu Dec 23 11:35:04 2010 +0100

    Do not allow default values for ref parameters

 vala/valaparameter.vala |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparameter.vala b/vala/valaparameter.vala
index aea16ef..7c52e9c 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");
 			}
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]