[vala/0.34] codegen: Trigger deprecation warning for NoArrayLength from a better place



commit 6cac12209675b532a677163363bfcaf4a256b844
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Oct 11 15:21:41 2016 +0200

    codegen: Trigger deprecation warning for NoArrayLength from a better place

 codegen/valaccodeattribute.vala    |    2 +-
 codegen/valaccodemethodmodule.vala |    4 ----
 vala/valausedattr.vala             |    1 +
 3 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index 81c70f2..a1270a1 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -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");
diff --git a/codegen/valaccodemethodmodule.vala b/codegen/valaccodemethodmodule.vala
index f7fbae7..7f13602 100644
--- a/codegen/valaccodemethodmodule.vala
+++ b/codegen/valaccodemethodmodule.vala
@@ -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) {
diff --git a/vala/valausedattr.vala b/vala/valausedattr.vala
index 191c124..c0ec253 100644
--- a/vala/valausedattr.vala
+++ b/vala/valausedattr.vala
@@ -49,6 +49,7 @@ public class Vala.UsedAttr : CodeVisitor {
                "Flags", "",
                "Experimental", "", // deprecated
                "NoReturn", "",
+               "NoArrayLength", "", // deprecated
                "Assert", "",
                "ErrorBase", "",
                "GenericAccessors", "",


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