Class: UndefinedType
compiler.UndefinedType
Represents an undefined custom type that was specified by the user, but can not be evaluated.
This is used to represent an invalid type that can not be used for type checking. If a type like this is encountered, then the type checking will silently fail, as this type should have already thrown an error.
Since
0.10.0
Hierarchy
-
↳
UndefinedType
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new UndefinedType(identifier
)
Parameters
Name | Type |
---|---|
identifier |
string |
Overrides
Defined in
kipper/core/src/compiler/semantics/types/undefined-type.ts:12
Properties
_identifier
• Protected
Readonly
_identifier: string
Inherited from
Defined in
kipper/core/src/compiler/semantics/types/base/type.ts:9
Accessors
identifier
• get
identifier(): string
The identifier of this type.
Returns
string
Inherited from
ProcessedType.identifier
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:19
isCompilable
• get
isCompilable(): false
Returns whether the type is compilable.
This is ALWAYS false, since this type can not be used for type checking.
Since
0.10.0
Returns
false
Overrides
ProcessedType.isCompilable
Defined in
kipper/core/src/compiler/semantics/types/undefined-type.ts:22
isGeneric
• get
isGeneric(): boolean
Returns whether the type is a generic type.
This is false unless overridden by a subclass.
Since
0.12.0
Returns
boolean
Inherited from
ProcessedType.isGeneric
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:38
isUnion
• get
isUnion(): boolean
Returns whether the type is a union type.
Since
0.12.0
Returns
boolean
Inherited from
ProcessedType.isUnion
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:46
Methods
assertAssignableTo
▸ assertAssignableTo(type
): boolean
Checks whether this type is assignable to another type.
Since
0.10.0
Parameters
Name | Type | Description |
---|---|---|
type |
ProcessedType |
The type to check against. |
Returns
boolean
Overrides
ProcessedType.assertAssignableTo
Defined in
kipper/core/src/compiler/semantics/types/undefined-type.ts:31
getCompilableType
▸ getCompilableType(): CompilableType
Gets the compilable type for this type.
This function throws an error instead of returning undefined, since it's intended to be used in circumstances, where only due to a bug the type is not compilable. As such, it makes sense to strictly assert it will be compilable, unless an error occurs.
Throws
UndefinedType If the isCompilable is false, which should only occur if the identifier is of type UndefinedType.
Since
0.10.0
Returns
Inherited from
ProcessedType.getCompilableType
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:60
isAssignableTo
▸ isAssignableTo(type
): boolean
Returns whether this type is assignable to the given type. This discards any error messages.
This simply returns whether the assertAssignableTo function throws an error or not.
Since
0.12.0
Parameters
Name | Type | Description |
---|---|---|
type |
ProcessedType |
The type to check against. |
Returns
boolean
Inherited from
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:84
toString
▸ toString(): string
Returns the full string representation of this type.
This also includes generic type arguments if this type is a generic type.
Since
0.12.0
Returns
string
Inherited from
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:93