Skip to content

Reject null-suppression operator in patterns #53484

@alrz

Description

@alrz

Branch: extended-property-patterns

We've relaxed pattern parsing to accept null-suppression and pointer access for error recovery.
As a consequence, the following is now valid:

public class C {
    public void M() {
        const C c = null;
        if (this is c!) {}       
    }
}

Any other case is caught by "constant expected" error, however, that specific scenario satisfies all the other requirements.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions