Class TypeSymbols
Provides built-in MuLang types and composite type factories.
public static class TypeSymbols
- Inheritance
-
TypeSymbols
- Inherited Members
Properties
Bool
Gets the built-in Boolean type.
public static TypeSymbol Bool { get; }
Property Value
Error
Gets the internal error-recovery type used in compiler contracts.
[Obsolete("Use ErrorRecovery instead.")]
public static TypeSymbol Error { get; }
Property Value
ErrorRecovery
Gets the internal error-recovery type used in compiler contracts.
public static TypeSymbol ErrorRecovery { get; }
Property Value
ErrorValue
Gets the built-in executable error-value type.
public static TypeSymbol ErrorValue { get; }
Property Value
Float
Gets the built-in floating-point type.
public static TypeSymbol Float { get; }
Property Value
Int
Gets the built-in integer type.
public static TypeSymbol Int { get; }
Property Value
Null
Gets the internal null-literal type used in compiler and IR contracts.
public static TypeSymbol Null { get; }
Property Value
Number
Gets the built-in general numeric type.
public static TypeSymbol Number { get; }
Property Value
Object
Gets the built-in general object type.
public static TypeSymbol Object { get; }
Property Value
Primitive
Gets the built-in common non-null primitive type.
public static TypeSymbol Primitive { get; }
Property Value
String
Gets the built-in string type.
public static TypeSymbol String { get; }
Property Value
Unknown
Gets the built-in dynamically checked unknown type.
public static TypeSymbol Unknown { get; }
Property Value
Void
Gets the built-in void type.
public static TypeSymbol Void { get; }
Property Value
Methods
Array(TypeSymbol)
Creates an array type.
public static ArrayTypeSymbol Array(TypeSymbol elementType)
Parameters
elementTypeTypeSymbolThe array element type.
Returns
- ArrayTypeSymbol
The array type.
Exceptions
- ArgumentNullException
Thrown when
elementTypeisnull.- ArgumentException
Thrown when the type cannot be used as an array element.
Nullable(TypeSymbol)
Creates a nullable type.
public static NullableTypeSymbol Nullable(TypeSymbol underlyingType)
Parameters
underlyingTypeTypeSymbolThe underlying non-nullable type.
Returns
- NullableTypeSymbol
The nullable type.
Exceptions
- ArgumentNullException
Thrown when
underlyingTypeisnull.- ArgumentException
Thrown when the type is already nullable or cannot be nullable.
ReadOnlyArray(TypeSymbol)
Creates a read-only array type.
public static ArrayTypeSymbol ReadOnlyArray(TypeSymbol elementType)
Parameters
elementTypeTypeSymbolThe array element type.
Returns
- ArrayTypeSymbol
The read-only array type.
Exceptions
- ArgumentNullException
Thrown when
elementTypeisnull.- ArgumentException
Thrown when the type cannot be used as an array element.