Skip to content

!! should be disallowed #29902

@AlekseyTs

Description

@AlekseyTs
        // PROTOTYPE(NullableReferenceTypes): Binder should report an error for `!!`.
        [Fact]
        public void SuppressNullableWarning_Multiple()
        {
            var source =
@"class C
{
    static void F(string? s)
    {
        G(default!!);
        G(s!!);
        G((s!)!);
    }
    static void G(string s)
    {
    }
}";
            var comp = CreateCompilation(
                new[] { source, NonNullTypesTrue, NonNullTypesAttributesDefinition },
                parseOptions: TestOptions.Regular8);
            comp.VerifyDiagnostics(/* ... */);
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions