Skip to content

Instantly share code, notes, and snippets.

@controlflow
Last active December 20, 2018 00:51
Show Gist options
  • Save controlflow/95828e927e184e933a3b07823fa60862 to your computer and use it in GitHub Desktop.
Save controlflow/95828e927e184e933a3b07823fa60862 to your computer and use it in GitHub Desktop.
[NotNull, Pure]
public static string Present(this TypeKind kind) {
switch (kind) {
case TypeKind.StaticClass: return "S";
case TypeKind.AbstractClass: return "A";
case TypeKind.Interface: return "I";
case TypeKind.Enumeration: return "E";
case TypeKind.ValueType: return "V";
default: return "C";
}
}
[NotNull, Pure]
public static string Present(this TypeKind kind) {
return kind switch {
TypeKind.StaticClass => "S",
TypeKind.AbstractClass => "A",
TypeKind.Interface => "I",
TypeKind.Enumeration => "E",
TypeKind.ValueType => "V",
_ => "C"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment