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

Analyze captured variables at the location lambda is converted to a delegate #29617

Closed
cston opened this issue Aug 31, 2018 · 0 comments
Closed

Comments

@cston
Copy link
Member

cston commented Aug 31, 2018

using System;

class C
{
    static T F<T>(Func<T> f)
    {
        throw null;
    }

    static void G(object? o)
    {
        F(() => o).ToString(); // warning: maybe null
        if (o == null) return;
        F(() => o).ToString(); // no warning
    }
}

See LDM-2018-06-04

@cston cston added this to the 16.0 milestone Aug 31, 2018
@jaredpar jaredpar added the Bug label Aug 31, 2018
@gafter gafter self-assigned this Jan 28, 2019
@gafter gafter modified the milestones: 16.0, 16.1 Feb 26, 2019
gafter added a commit to gafter/roslyn that referenced this issue Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants