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 mismatch is not reported for an assignment of Anonymous Types #29889

Closed
AlekseyTs opened this issue Sep 14, 2018 · 1 comment
Closed

Comments

@AlekseyTs
Copy link
Contributor


        [Fact]
        public void AnonymousTypes_01()
        {
            CSharpCompilation c = CreateCompilation(new[] { @"
class C
{
    static void Main()
    {}

    void Test2(CL1 x2, CL1? z2)
    {
        var u2 = new { p1 = x2, p2 = z2 };
        var v2 = new { p1 = z2, p2 = x2 };
        u2 = v2;
    }
}

class CL1
{
}
",
NonNullTypesTrue, NonNullTypesAttributesDefinition });

            // PROTOTYPE(NullableReferenceTypes): Why isn't u2 = v2 causing a warning?
            c.VerifyDiagnostics(
                );
        }
@jcouv
Copy link
Member

jcouv commented Sep 17, 2018

Relates to #24018

@jcouv jcouv added this to the 16.0 milestone Sep 17, 2018
@cston cston self-assigned this Feb 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

3 participants