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

Pattern variables are treated as oblivious #33499

Closed
gafter opened this issue Feb 19, 2019 · 0 comments
Closed

Pattern variables are treated as oblivious #33499

gafter opened this issue Feb 19, 2019 · 0 comments
Assignees
Labels
Area-Compilers Bug Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@gafter
Copy link
Member

gafter commented Feb 19, 2019

The following code should cause a warning when null is assigned to the non-nullable variable s, but no warning is produced.

#nullable enable
class Test
{
    static void M(object o)
    {
        if (o is string s) { }
        s = null;
    }
}
@gafter gafter added this to the 16.1 milestone Feb 19, 2019
@gafter gafter added the Bug label Feb 19, 2019
@gafter gafter self-assigned this Feb 20, 2019
gafter added a commit to gafter/roslyn that referenced this issue Mar 19, 2019
gafter pushed a commit to gafter/roslyn that referenced this issue Mar 19, 2019
gafter pushed a commit to gafter/roslyn that referenced this issue Mar 19, 2019
jaredpar pushed a commit that referenced this issue Mar 30, 2019
* Implement pattern-matching in the nullable walker

Fixes #29909
Fixes #31881
Fixes #30952
Fixes #33499
Fixes #30597
Fixes #32414
Fixes #23944

* Remove infinite recursion by using an empty struct cache.

* Changes per code review comments.

* Remove debugging code accidentally left behind.

* Analysis of patterns-matching in the nullable walker requires valid (>0) slots.

* Skip a flaky test

* Patch after merge.

* Make ctor private to force use of factory methods

* Correct a typo.

* Fixup after merge.
@sharwell sharwell added the Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented label Mar 30, 2019
@sharwell sharwell modified the milestones: 16.1, 16.1.P2 Mar 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Feature - Nullable Reference Types Nullable Reference Types Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

2 participants