From: Jürg Billeter Date: Sat, 16 Oct 2010 07:32:18 +0000 (+0200) Subject: Report error when trying to create an array of delegates with targets X-Git-Tag: 0.11.1~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d57ead91f95c1c3528be041fdbd37293f347435d;p=thirdparty%2Fvala.git Report error when trying to create an array of delegates with targets Fixes bug 632017. --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 0575c3ee3..a8ec581b3 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -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);