]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
valaparser: Warn about "static const" declarations where "static" is superfluous
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 8 Jun 2016 18:15:22 +0000 (20:15 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 13 Jun 2016 06:04:02 +0000 (08:04 +0200)
vala/valaparser.vala

index e25eef89532bd033f5d148528dd3c25ec96d4432..3cbc56178a1674b360e75ca5f8d9f2815a654eb0 100644 (file)
@@ -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);
        }