I'm writing an application using Roslyn to syntactically and semantically analyse C# source code. For each type defined in the source code being analysed, I would like to store whether it's a reference type (a class), a value type (a struct) or an interface.
What's the appropriate/official term for a type's type?
Example:
class A
{
//This type's type (A's type) is 'class' (i.e. a reference type).
}
Some common synonyms of type are character, description, kind, nature, and sort. While all these words mean "a number of individuals thought of as a group because of a common quality or qualities," type may suggest strong and clearly marked similarity throughout the items included so that each is typical of the group.
species. noun. informal a type of person described according to a particular aspect of their character.
Definition of type specimen : a specimen or individual designated as type of a species or lesser group and serving as the final criterion of the characteristics of that group.
If you want to know the official name, look into the official source: the C# language specification. Quoting from there (§1.3 Types and variables; emphasis mine):
There are two kinds of types in C#: value types and reference types. […]
C#’s value types are further divided into simple types, enum types, struct types, and nullable types, and C#’s reference types are further divided into class types, interface types, array types, and delegate types.
Then there is a table that describes those groups of types as category, and also this quote:
Five of C#’s categories of types are user-definable: class types, struct types, interface types, enum types, and delegate types.
Although later (in §4 Types):
The types of the C# language are divided into two main categories: Value types and reference types.
To sum up, the specification calls them categories of types, although its usage of that term is not very consistent.
In type theory, the type of a type is usually called its kind. That primarily describes the form of parameterisation of a type, although it can be used for other classifications, too. But I'm not sure whether it applies naturally to the sort of classification you are referring to here. It seems that C# does not have an "official" term for that either.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With