Skip to content

[Strict] Diagnose type test of a static type #30198

@gafter

Description

@gafter

Roslyn permits a type test of a static type, failing to diagnose the following:

static class Fiz
{
}

    bool M(object o)
    {
        return o is Fiz; // error: cannot use a static type in 'is' or 'as'
    }

This is correctly diagnosed as an error in "strict" mode.

Please diagnose this in a warning wave.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions