[vala] genie: Warn about "const static" declarations where "static" is superfluous



commit e152b1d98e807dcf2c0d959315e61d145eac68b6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jun 8 20:45:11 2016 +0200

    genie: Warn about "const static" declarations where "static" is superfluous

 vala/valagenieparser.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index 3c71d92..46c6000 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -2789,6 +2789,11 @@ public class Vala.Genie.Parser : CodeVisitor {
                }
                
                set_attributes (c, attrs);
+
+               if (ModifierFlags.STATIC in flags) {
+                       Report.warning (c.source_reference, "the modifier `static' is not applicable to 
constants");
+               }
+
                return c;
        }
 


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