Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support implicit conversions of lambda expressions to LambdaExpression #56200

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

cston
Copy link
Member

@cston cston commented Sep 4, 2021

Fixes #56033.

Relates to test plan #52192

@cston cston requested a review from a team as a code owner September 4, 2021 22:12
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (iteration 1)

@cston cston requested a review from a team September 13, 2021 21:31
@RikkiGibson RikkiGibson self-assigned this Sep 14, 2021
comp.VerifyDiagnostics(
// (7,30): error CS1660: Cannot convert lambda expression to type 'LambdaExpression' because it is not a delegate type
// LambdaExpression e = () => 1;
Diagnostic(ErrorCode.ERR_AnonMethToNonDel, "() => 1").WithArguments("lambda expression", "System.Linq.Expressions.LambdaExpression").WithLocation(7, 30),
Copy link
Contributor

@RikkiGibson RikkiGibson Sep 14, 2021

Choose a reason for hiding this comment

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

I wouldn't ask you to make any such change in this PR, but I am wondering if it is practical to make a change analogous to the one in this PR to improve the diagnostics when the feature isn't supported in the user's LangVersion: https://github.com/dotnet/roslyn/pull/54797/files
#Resolved

Copy link
Member Author

Choose a reason for hiding this comment

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

@cston cston merged commit 28d5725 into dotnet:main Sep 14, 2021
@ghost ghost added this to the Next milestone Sep 14, 2021
@cston cston deleted the LambdaExpression branch September 14, 2021 21:20
@Cosifne Cosifne modified the milestones: Next, 17.0.P5 Sep 27, 2021
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.

Cannot convert lambda expression to LambdaExpression
4 participants