Skip to content

Consistently extract synthesized delegate info from method symbol#64966

Merged
jjonescz merged 12 commits intodotnet:features/lambda-default-parametersfrom
jjonescz:ldp-attr-forwarding
Nov 1, 2022
Merged

Consistently extract synthesized delegate info from method symbol#64966
jjonescz merged 12 commits intodotnet:features/lambda-default-parametersfrom
jjonescz:ldp-attr-forwarding

Conversation

@jjonescz
Copy link
Copy Markdown
Member

@jjonescz jjonescz commented Oct 25, 2022

This PR consolidates learnings from #64823 and #64932 but without the actual attribute forwarding from lambdas to synthesized delegate types.

In particular, Binder.GetMethodGroupOrLambdaDelegateType is updated to consistently derive information it needs from MethodSymbol as suggested in #64823 (comment). (See the first commit: 27d5cfe.)

This in turn fixes a bug where DefaultParameterValue was allowed without Optional in lambdas. (See the second commit: 5a60ba7.)

Tests of [CallerMemberName]+friends and [AllowNull]+friends in lambdas were also enabled in this PR since the decision about attribute forwarding has been made. (See the rest of the commits.)

Relates to test plan #62485.

@jjonescz jjonescz marked this pull request as ready for review October 26, 2022 10:27
@jjonescz jjonescz requested a review from a team as a code owner October 26, 2022 10:27
@jjonescz
Copy link
Copy Markdown
Member Author

Also realized that some changes in UnboundLambda.InferDelegateType from #63787 could not be preserved during merge of main to this feature branch in the past, but after this consolidation, they can be brought back, so I'm appending this minor change: a750d76

Copy link
Copy Markdown
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor nit, otherwise LGTM

@jjonescz jjonescz enabled auto-merge (squash) November 1, 2022 08:30
@jjonescz jjonescz merged commit 8f05530 into dotnet:features/lambda-default-parameters Nov 1, 2022
@jjonescz jjonescz deleted the ldp-attr-forwarding branch November 1, 2022 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants