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

SA1130 (UseLambdaSyntax) incorrect fix #3510

Closed
kindermannhubert opened this issue May 18, 2022 · 0 comments · Fixed by #3516
Closed

SA1130 (UseLambdaSyntax) incorrect fix #3510

kindermannhubert opened this issue May 18, 2022 · 0 comments · Fixed by #3516

Comments

@kindermannhubert
Copy link

var f = (Func<int>)delegate() { return 1; };

is fixed to

var f = (Func<int>)() => { return 1; };

which does not build (missing parenthesis).

It needs to be fixed to

var f = (Func<int>)(() => { return 1; });
bjornhellander added a commit to bjornhellander/StyleCopAnalyzers that referenced this issue Feb 12, 2023
… original delegate expression is part of a cast expression

DotNetAnalyzers#3510
bjornhellander added a commit to bjornhellander/StyleCopAnalyzers that referenced this issue Feb 16, 2023
… original delegate expression is part of a cast expression

DotNetAnalyzers#3510
bjornhellander added a commit to bjornhellander/StyleCopAnalyzers that referenced this issue Apr 15, 2023
… original delegate expression is part of a cast expression

DotNetAnalyzers#3510
@sharwell sharwell added this to the 1.2-beta.next milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants