Type Definition
From Pigmeo Development Wiki
This is the list of keywords available for type definitions.
Note: quoted text was taken from the ECMA-335 specs.
Contents |
Visibility
- nested assembly
- nested famandassem
- nested family
- nested famorassem
- nested private
- nested public
Layout
- auto - "The layout shall be done by the CLI, with no user-supplied constraints". "The default auto layout should provide the best layout for the platform on which the code is executing."
- explicit - "The layout of the fields is explicitly provided. However, a generic type shall not have explicit layout". "Explicit layout allows the CIL generator to specify the precise layout semantics."
- sequential - "The CLI shall lay out the fields in sequential order, based on the order of the fields in the logical metadata table". "Sequential layout is intended to instruct the CLI to match layout rules commonly followed by languages like C and C++ on an individual platform, where this is possible while still guaranteeing verifiable layout.
Semantics
- interface
Inheritance
- abstract - "Specifies that this type shall not be instantiated. If a type contains abstract methods, that type shall be declared as an abstract type"
- sealed - "A type shall not have derived classes. All value types shall be sealed". Ignore
Interoperation
"These attributes are for interoperation with unmanaged code. They specify the default behavior to be used when calling a method (static, instance, or virtual) on the class, that has an argument or return type of System.String and does not itself specify marshalling behavior. Only one value shall be specified for any type, and the default value is ansi"
- ansi - "Marshalling shall be to and from ANSI strings"
- autochar - "Specifies marshalling behavior (either ANSI or Unicode), depending on the platform on which the CLI is running"
- unicode - "Marshalling shall be to and from Unicode strings"
Since Pigmeo doesn't support calling unmanaged code, we can safely ignore interoperation keywords.
Special handling
- beforefieldinit - "It need not initialize the type before a static method is called". Classes with explicit static constructors are not beforefieldinit. If not marked beforefieldinit the static constructor is called before ANY access to the class (static, instance or virtual fields or members). If marked beforefieldinit the static constructor is called before accessing any static field or method.
- rtspecialname - "The name of this item has special significance to the CLI. There are no currently defined special type names; this is for future use. Any item marked rtspecialname shall also be marked specialname"
- serializable - "Reserved for future use, to indicate that the fields of the type are to be serialized into a data stream (should such support be provided by the implementation)"
- specialname - "The name of this item can have special significance to tools other than the CLI"
See also
- ECMA-335 Partition II, Section 10.1

