]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when trying to create an array of delegates with targets
authorJürg Billeter <j@bitron.ch>
Sat, 16 Oct 2010 07:32:18 +0000 (09:32 +0200)
committerJürg Billeter <j@bitron.ch>
Sat, 16 Oct 2010 07:32:18 +0000 (09:32 +0200)
Fixes bug 632017.

codegen/valaccodebasemodule.vala

index 0575c3ee3f95dc489ee8434f1b6eeb4631e5444c..a8ec581b349c32774eb82d27a7303326ff24b4ab 100644 (file)
@@ -3902,6 +3902,12 @@ public class Vala.CCodeBaseModule : CodeGenerator {
                var array_type = type as ArrayType;
                if (array_type != null) {
                        check_type (array_type.element_type);
+                       if (array_type.element_type is DelegateType) {
+                               var delegate_type = (DelegateType) array_type.element_type;
+                               if (delegate_type.delegate_symbol.has_target) {
+                                       Report.error (type.source_reference, "Delegates with target are not supported as array element type");
+                               }
+                       }
                }
                foreach (var type_arg in type.get_type_arguments ()) {
                        check_type (type_arg);