Skip to content

More Assertions on types #645

@jnyrup

Description

@jnyrup

We do have an impressive amount of type assertions.
I've tried to lookup the .net type hierarchy and keywords to see what we might be missing.
See the bottom for types and keywords.

Here's a rough sketch of what such APIs could look like, but please notice that I haven't checked if they are:

  • even possible
  • desirable.

References:

Type hierachy:
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/members

  • Members
    • Fields
    • Constants
    • Properties
    • Methods
    • Events
    • Operators
    • Indexers
    • Constructors
    • Finalizers
  • Classes
  • Structs
  • Interfaces
  • StaticConstructors

Keywords and which type they apply to:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/

  • member, type
    • access modifiers:
      • private
      • protected
      • public
      • internal
      • protected Internal
  • classes, fields, methods, properties, operators, events, and constructors
    • static
  • method, property, indexer, or event
    • virtual
    • override
  • member
    • new
  • type
    • abstract
    • unsafe
  • method
    • extern
    • async
  • class
    • sealed
  • class, struct, interface, method
    • partial
  • field
    • volatile
    • readonly
    • const

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions