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

Nullability of conditional access with unconstrained type parameters #33430

Closed
jcouv opened this issue Feb 15, 2019 · 1 comment
Closed

Nullability of conditional access with unconstrained type parameters #33430

jcouv opened this issue Feb 15, 2019 · 1 comment
Assignees
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Feb 15, 2019

What is the nullability of x?.F()?

class C<T, U>
    where T : U
    where U : C<T, U>?
{
    static void M(U x)
    {
        U y = x?.F();
        T z = x?.F();
    }
    T F() => throw null;
}

Resolved 2/13/2019:

The nullability of a conditional invocation is always nullable.

@gafter
Copy link
Member

gafter commented Mar 5, 2019

Fixed and tested in #33648

@gafter gafter closed this as completed Mar 5, 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

2 participants