[vala] Error on non-const field initializer in namespace



commit 1b3b48aa7e8b550643499bf842c0ca92056aa520
Author: Simon Werbeck <simon werbeck gmail com>
Date:   Mon Apr 1 05:00:12 2013 +0200

    Error on non-const field initializer in namespace
    
    Fixes bug 569259

 vala/valafield.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valafield.vala b/vala/valafield.vala
index 8b932a5..48986cc 100644
--- a/vala/valafield.vala
+++ b/vala/valafield.vala
@@ -143,6 +143,12 @@ public class Vala.Field : Variable, Lockable {
                                return false;
                        }
 
+                       if (parent_symbol is Namespace && !initializer.is_constant ()) {
+                               error = true;
+                               Report.error (source_reference, "Non-constant field initializerS not 
supported in this context");
+                               return false;
+                       }
+
                        if (external) {
                                error = true;
                                Report.error (source_reference, "External fields cannot use initializers");


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