From: Jürg Billeter Date: Tue, 28 Jul 2009 14:27:58 +0000 (+0200) Subject: Support delegates without target as generic type arguments X-Git-Tag: 0.7.5~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d27cb3acb756fe1d8ac2a5c83c3a0a61302f85d3;p=thirdparty%2Fvala.git Support delegates without target as generic type arguments Based on patch by Levi Bard, fixes bug 519949. --- diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala index 3b51d4289..ea5fd2389 100644 --- a/codegen/valaccodebasemodule.vala +++ b/codegen/valaccodebasemodule.vala @@ -2971,6 +2971,11 @@ internal class Vala.CCodeBaseModule : CCodeModule { || is_signed_integer_type_argument (type_arg) || is_unsigned_integer_type_argument (type_arg)) { // no error + } else if (type_arg is DelegateType) { + var delegate_type = (DelegateType) type_arg; + if (delegate_type.delegate_symbol.has_target) { + Report.error (type_arg.source_reference, "Delegates with target are not supported as generic type arguments"); + } } else { Report.error (type_arg.source_reference, "`%s' is not a supported generic type argument, use `?' to box value types".printf (type_arg.to_string ())); }