[vala/wip/valaparser: 1/3] valaparser: Warn about "static const" declarations where "static" is superfluous



commit 8a64d84ab74f119291008d98db990ac10e569817
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Jun 8 20:15:22 2016 +0200

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

 vala/valaparser.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/vala/valaparser.vala b/vala/valaparser.vala
index e25eef8..3cbc561 100644
--- a/vala/valaparser.vala
+++ b/vala/valaparser.vala
@@ -2572,6 +2572,10 @@ public class Vala.Parser : CodeVisitor {
                }
                set_attributes (c, attrs);
 
+               if (ModifierFlags.STATIC in flags) {
+                       Report.warning (c.source_reference, "the modifier `static' is not applicable to 
constants");
+               }
+
                parent.add_constant (c);
        }
 


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