public override void visit_lambda_expression (LambdaExpression lambda) {
var delegate_type = (DelegateType) lambda.target_type;
- var d = delegate_type.delegate_symbol;
-
- lambda.method.set_attribute_bool ("CCode", "array_length", get_ccode_array_length (d));
- lambda.method.set_attribute_bool ("CCode", "array_null_terminated", get_ccode_array_null_terminated (d));
- lambda.method.set_attribute_string ("CCode", "array_length_type", get_ccode_array_length_type (d));
lambda.accept_children (this);
method.used = true;
method.version.check (source_reference);
+ if (return_type is ArrayType) {
+ method.copy_attribute_bool (cb, "CCode", "array_length");
+ method.copy_attribute_bool (cb, "CCode", "array_null_terminated");
+ method.copy_attribute_string (cb, "CCode", "array_length_type");
+ } else if (return_type is DelegateType) {
+ method.copy_attribute_bool (cb, "CCode", "delegate_target");
+ }
+
if (!cb.has_target || !context.analyzer.is_in_instance_method ()) {
method.binding = MemberBinding.STATIC;
} else {