Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #72134

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner February 16, 2024 02:35
@ghost ghost added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Feb 16, 2024
//
// This cast is necessary. The language does not allow lambdas to be directly converted to the destination
// type without explicitly stating the intermediary reified delegate type.
var isAnonymousFunctionCast = castedExpressionNode.WalkDownParentheses() is AnonymousFunctionExpressionSyntax;
Copy link
Contributor

Choose a reason for hiding this comment

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

WalkDownParentheses

assume it's not expensive to call as it was called a couple lines above too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be nearly free. It's normally a no-op, or occasionally a walk of one node.

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi merged commit d3a41ae into dotnet:main Feb 16, 2024
@ghost ghost added this to the Next milestone Feb 16, 2024
@CyrusNajmabadi CyrusNajmabadi deleted the delegateCast branch February 16, 2024 07:14
@jjonescz jjonescz modified the milestones: Next, 17.10 P2 Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect cast-can-be-removed suggestion with lambdas and implicit operators.

3 participants