]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Support delegates without target as generic type arguments
authorJürg Billeter <j@bitron.ch>
Tue, 28 Jul 2009 14:27:58 +0000 (16:27 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 28 Jul 2009 14:27:58 +0000 (16:27 +0200)
Based on patch by Levi Bard, fixes bug 519949.

codegen/valaccodebasemodule.vala

index 3b51d42897f8280008c818818b13915a7fded41a..ea5fd2389dce3f92cc859814bff26575d4bb06fd 100644 (file)
@@ -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 ()));
                }