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



commit ef5ae7d1c49fb54d05a8aba0e176c097c939737a
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 f9c9ab6..d7cb200 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -473,7 +473,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 4baa9fa..8e70f84 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 14cdd97..14fe1d2 100644
--- a/vala/valausedattr.vala
+++ b/vala/valausedattr.vala
@@ -48,6 +48,7 @@ public class Vala.UsedAttr : CodeVisitor {
                "Flags", "",
                "Experimental", "",
                "NoReturn", "",
+               "NoArrayLength", "", // deprecated
                "Assert", "",
                "ErrorBase", "",
                "GenericAccessors", "",


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