]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Trigger deprecation warning for NoArrayLength from a better place
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 11 Oct 2016 13:21:41 +0000 (15:21 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 6 Oct 2017 12:44:10 +0000 (14:44 +0200)
codegen/valaccodeattribute.vala
codegen/valaccodemethodmodule.vala
vala/valausedattr.vala

index 81c70f222990fb2a8750a4cc543b5aecebc11328..a1270a113b427e84157213c0cdb101ec276261f2 100644 (file)
@@ -492,7 +492,7 @@ public class Vala.CCodeAttribute : AttributeCache {
                get {
                        if (_array_length == null) {
                                if (node.get_attribute ("NoArrayLength") != null) {
-                                       // deprecated
+                                       Report.deprecated (node.source_reference, "[NoArrayLength] is deprecated, use [CCode (array_length = false)] instead.");
                                        _array_length = false;
                                } else if (ccode != null && ccode.has_argument ("array_length")) {
                                        _array_length = ccode.get_bool ("array_length");
index f7fbae783359a458731bbcfc6c38ad56715051cc..7f13602e097271a23fdf237ce197bbd73f1c05fe 100644 (file)
@@ -306,10 +306,6 @@ public abstract class Vala.CCodeMethodModule : CCodeStructModule {
 
                bool profile = m.get_attribute ("Profile") != null;
 
-               if (m.get_attribute ("NoArrayLength") != null) {
-                       Report.deprecated (m.source_reference, "NoArrayLength attribute is deprecated, use [CCode (array_length = false)] instead.");
-               }
-
                if (m is CreationMethod) {
                        var cl = current_type_symbol as Class;
                        if (cl != null && !cl.is_compact) {
index 191c1248cfa292fdf0d2effc2c794d1f36921915..c0ec2533e5cb9dc9bc2246174b54fc5a79c4e8b1 100644 (file)
@@ -49,6 +49,7 @@ public class Vala.UsedAttr : CodeVisitor {
                "Flags", "",
                "Experimental", "", // deprecated
                "NoReturn", "",
+               "NoArrayLength", "", // deprecated
                "Assert", "",
                "ErrorBase", "",
                "GenericAccessors", "",