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

Roslyn does not provide a way to suppress nullability warnings on the left side of a compound assignments #36617

Open
TessenR opened this issue Jun 20, 2019 · 1 comment

Comments

@TessenR
Copy link

TessenR commented Jun 20, 2019

Version Used:

Branch master (19 Jun 2019)
Latest commit e1146e by Sam Harwell:
Merge pull request #36366 from sharwell/order-naming-rules

Implement subset-based ordering for naming rules

Steps to Reproduce:

#nullable enable
class D
{
    void M(D? d)
    {
        d += d; // CS8604
        // d! += d; // does not compile
        // (d)! += d; // does not compile
    }
    
    public static extern D operator +(D d1, D? d2);
}

Expected Behavior:
You can suppress nullability warnings in the compound assignment since nullability analysis might be incorrect.

Actual Behavior:
There's no way to suppress it with a !.

@RikkiGibson
Copy link
Contributor

@jcouv I believe this relates to #27522 and #33869

@jcouv jcouv added this to the 16.3 milestone Jun 20, 2019
@jcouv jcouv modified the milestones: 16.3, Compiler.Next Jul 11, 2019
@jaredpar jaredpar modified the milestones: Compiler.Next, Backlog Sep 12, 2023
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