[vala] Support delegates without target as generic type arguments



commit d27cb3acb756fe1d8ac2a5c83c3a0a61302f85d3
Author: Jürg Billeter <j bitron ch>
Date:   Tue Jul 28 16:27:58 2009 +0200

    Support delegates without target as generic type arguments
    
    Based on patch by Levi Bard, fixes bug 519949.

 codegen/valaccodebasemodule.vala |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 3b51d42..ea5fd23 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 ()));
 		}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]