Skip to content

Compiler or analyzer should warn for lower-cased type names #56653

@jcouv

Description

@jcouv

During LDM discussion on records, there was interest to have an analyzer warn on lower-cased type names. The motivation is that knowing that we discourage lower-cased type names would allow us to introduce new keywords (like record) with less concern about the breaking change.

I'm not sure whether this should be done by the compiler, a roslyn analyzer or some BCL analyzer.

Design:

  • We use char.IsLower(...) for lower-case check.
  • @ prefix avoids warning.
  • All named types, included delegate types, are checked.
  • Type and namespace aliases are checked too.

FYI @mikadumont @jmarolf

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Complete

Status

Active/Investigating

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions