Skip to content

Include underlying conversions when tracking nullability of tuple deconstruction #33011

Open

Description

@cston

The following should result in exactly one warning, for y.Value.F.ToString():

#pragma warning disable 0649

struct S
{
    internal object F;
}

class Program
{
    static void F(S s)
    {
        (S, S) t = (s, new S());
        (S? x, S? y) = t;
        _ = x.Value;
        x.Value.F.ToString();
        _ = y.Value;
        y.Value.F.ToString(); // warning: 'F' maybe null
    }
}

Activity

  1. self-assigned this
    on Jan 31, 2019
  2. cston commented on Jan 31, 2019

    @cston
    ContributorAuthor

    See NullableReferenceTypesTests.Deconstruction_ImplicitNullableConversion_02, NullableReferenceTypesTests.Deconstruction_ImplicitBoxingConversion_02.

  3. assigned and unassigned on Feb 15, 2019
  4. added this to the 16.1 milestone on Feb 18, 2019
  5. self-assigned this
    on Apr 16, 2019
  6. modified the milestones: 16.1, 16.2 on Apr 23, 2019
  7. modified the milestones: 16.2, Compiler.Next on Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions