Table of Contents

Class TypeSymbols

Namespace
MuLang.Core.Types
Assembly
MuLang.Core.dll

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

TypeSymbol

Error

Gets the internal error-recovery type used in compiler contracts.

[Obsolete("Use ErrorRecovery instead.")]
public static TypeSymbol Error { get; }

Property Value

TypeSymbol

ErrorRecovery

Gets the internal error-recovery type used in compiler contracts.

public static TypeSymbol ErrorRecovery { get; }

Property Value

TypeSymbol

ErrorValue

Gets the built-in executable error-value type.

public static TypeSymbol ErrorValue { get; }

Property Value

TypeSymbol

Float

Gets the built-in floating-point type.

public static TypeSymbol Float { get; }

Property Value

TypeSymbol

Int

Gets the built-in integer type.

public static TypeSymbol Int { get; }

Property Value

TypeSymbol

Null

Gets the internal null-literal type used in compiler and IR contracts.

public static TypeSymbol Null { get; }

Property Value

TypeSymbol

Number

Gets the built-in general numeric type.

public static TypeSymbol Number { get; }

Property Value

TypeSymbol

Object

Gets the built-in general object type.

public static TypeSymbol Object { get; }

Property Value

TypeSymbol

Primitive

Gets the built-in common non-null primitive type.

public static TypeSymbol Primitive { get; }

Property Value

TypeSymbol

String

Gets the built-in string type.

public static TypeSymbol String { get; }

Property Value

TypeSymbol

Unknown

Gets the built-in dynamically checked unknown type.

public static TypeSymbol Unknown { get; }

Property Value

TypeSymbol

Void

Gets the built-in void type.

public static TypeSymbol Void { get; }

Property Value

TypeSymbol

Methods

Array(TypeSymbol)

Creates an array type.

public static ArrayTypeSymbol Array(TypeSymbol elementType)

Parameters

elementType TypeSymbol

The array element type.

Returns

ArrayTypeSymbol

The array type.

Exceptions

ArgumentNullException

Thrown when elementType is null.

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

underlyingType TypeSymbol

The underlying non-nullable type.

Returns

NullableTypeSymbol

The nullable type.

Exceptions

ArgumentNullException

Thrown when underlyingType is null.

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

elementType TypeSymbol

The array element type.

Returns

ArrayTypeSymbol

The read-only array type.

Exceptions

ArgumentNullException

Thrown when elementType is null.

ArgumentException

Thrown when the type cannot be used as an array element.