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

Report nullable warnings for user-defined conversions on tuple elements #29699

Open
cston opened this issue Sep 6, 2018 · 0 comments
Open

Report nullable warnings for user-defined conversions on tuple elements #29699

cston opened this issue Sep 6, 2018 · 0 comments

Comments

@cston
Copy link
Member

cston commented Sep 6, 2018

[module: System.Runtime.CompilerServices.NonNullTypes]
class A
{
    public static implicit operator C(A a) => new C();
}
class B : A
{
}
class C
{
    static void F((B?, B) x, (B, B?) y)
    {
        (C, C?) c;
        c = x;
        c = y;
    }
}

Expected:

(14,13): warning CS8604: Possible null reference argument for parameter 'a'
    in 'A.implicit operator C(A a)'
(15,13): warning CS8604: Possible null reference argument for parameter 'a'
    in 'A.implicit operator C(A a)'

Actual:

(14,13): warning CS8619: Nullability of reference types in value of type '(B?, B)'
    doesn't match target type '(C, C?)'.
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

4 participants