GrType

Compiler type definition for Grimoire's type system. It doesn't mean anything for the VM.

Constructors

this
this(GrBaseType baseType_)

Init as a basic type.

this
this(GrBaseType baseType_, string mangledType_)

Compound type.

Members

Functions

opEquals
bool opEquals(GrBaseType v)

Check general type equality.

opEquals
bool opEquals(GrType v)

Check full type equality.

opOpAssign
GrType opOpAssign(GrBaseType t)

Only assign a simple type (baseType).

toHash
size_t toHash()

Only to disable warnings because of opEquals.

Variables

baseType
GrBaseType baseType;

General type, basic types only use that while compound types also use mangledType and mangledReturnType.

isAbstract
bool isAbstract;

Is the type abstract ? An abstract type cannot be used in signatures.

isAny
bool isAny;

Can this type match with others ?

isField
bool isField;

Is this from an object field ?

mangledReturnType
string mangledReturnType;

Used for compound types like arrays, functions, etc.

mangledType
string mangledType;

Used for compound types like arrays, functions, etc.

predicate
bool function(GrType, GrAnyData) predicate;

Predicate to validate any type

Meta