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



commit bbd2a1b416d91d0f830c6a86bea6b99d73b4195a
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]