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

Fix S1168: Rule should not report when returning null within a lambda #761

Closed
Evangelink opened this issue Sep 8, 2017 · 0 comments
Closed
Assignees
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Milestone

Comments

@Evangelink
Copy link
Contributor

Evangelink commented Sep 8, 2017

Description

Currently the rule raises an issue when returning null from within a lambda declared inside of a method returning a collection.

Repro steps

public List<int> Method()
{
    Func<int?> aFunc = () => {
        return null;
    };
    return new List<int>();
}

Related information

  • SonarLint for VS 3.5.0.1803
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: False Positive Rule IS triggered when it shouldn't be.
Projects
None yet
Development

No branches or pull requests

1 participant