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

Infer nullability of receiver and member from ?. expression #25870

Closed
cston opened this issue Apr 1, 2018 · 2 comments
Closed

Infer nullability of receiver and member from ?. expression #25870

cston opened this issue Apr 1, 2018 · 2 comments

Comments

@cston
Copy link
Member

cston commented Apr 1, 2018

There should be no warnings in the following. Currently, Possible dereference of a null reference is reported for c and c.F in c.F.ToString().

class C
{
    object? F;
    static void M(C? c)
    {
        if (c?.F != null)
            c.F.ToString();
    }
}
@cston
Copy link
Member Author

cston commented Apr 1, 2018

cc @bkoelman

@jcouv
Copy link
Member

jcouv commented Jul 25, 2018

Fixed by #28722

@jcouv jcouv closed this as completed Jul 25, 2018
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

2 participants