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

Should we analyze tuples element-wise? #35695

Open
jcouv opened this issue May 14, 2019 · 0 comments
Open

Should we analyze tuples element-wise? #35695

jcouv opened this issue May 14, 2019 · 0 comments

Comments

@jcouv
Copy link
Member

jcouv commented May 14, 2019

I will collect a few examples to show how we treat tuples element-wise in type inference and with regards to variance, but we don't do so for nullability analysis.

#nullable enable
class Program
{
    static void F((object?, int?) t)
    {
        _ = ((object, int?))t; // not great warning CS8619: Nullability of reference types in value of type '(object?, int?)' doesn't match target type '(object, int?)'.
        _ = (object)t.Item1;

        _ = ((string?, int))t; // not great warning CS8619: Nullability of reference types in value of type '(object?, int?)' doesn't match target type '(string?, int)'.
        _ = (int)t.Item2;
    }
}
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