]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Deprecate implicit copy of arrays, use explicit copy method
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 3 Sep 2017 17:48:31 +0000 (19:48 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 21 Mar 2018 13:23:45 +0000 (14:23 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=650663

codegen/valaccodebasemodule.vala

index 9f02b8c77894e30c65cddf0ac5050bf61637c4b0..3de943864a9c9c7d9f4d3829d23ba53dc54bbecd 100644 (file)
@@ -5876,6 +5876,13 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
                                return result;
                        }
                        result = copy;
+
+                       // implicit array copying is deprecated, but allow it for internal codegen usage
+                       var prop_acc = node as PropertyAccessor;
+                       if ((prop_acc != null && !prop_acc.automatic_body)
+                           && result.value_type is ArrayType) {
+                               Report.deprecated (node.source_reference, "implicit copy of array is deprecated, explicitly invoke the copy method instead");
+                       }
                }
 
                return result;