Interface: GenericType<T>
compiler.GenericType
Represents a type which takes in generic type arguments.
Since
0.12.0
Type parameters
| Name | Type |
|---|---|
T |
extends GenericTypeArguments |
Hierarchy
-
↳
GenericType
Implemented by
Table of contents
Properties
Accessors
Methods
Properties
_identifier
• Protected Readonly _identifier: string
Inherited from
Defined in
kipper/core/src/compiler/semantics/types/base/type.ts:9
genericTypeArguments
• Readonly genericTypeArguments: T
The generic type arguments for this type.
Since
0.12.0
Defined in
kipper/core/src/compiler/semantics/types/base/generic-type.ts:23
isGeneric
• Readonly isGeneric: true
Returns whether the type is a generic type.
Since
0.12.0
Overrides
Defined in
kipper/core/src/compiler/semantics/types/base/generic-type.ts:18
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
• Abstract get isCompilable(): boolean
Returns whether the type is compilable.
This function exists, since during type checking an undefined/invalid type may be encountered that should still be stored using this class though (but NOT compiled!).
Since
0.10.0
Returns
boolean
Inherited from
ProcessedType.isCompilable
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:30
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
▸ Abstract assertAssignableTo(type, propertyName?, argumentName?): void
Asserts that this type is assignable to the given type.
Throws
TypeError If the types are not assignable.
Since
0.12.0
Parameters
| Name | Type | Description |
|---|---|---|
type |
ProcessedType |
The type to check against. |
propertyName? |
string |
The name of the property that is being assigned. This is used for error messages. |
argumentName? |
string |
The name of the argument that is being assigned to. This is used for error messages. |
Returns
void
Inherited from
ProcessedType.assertAssignableTo
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:75
changeGenericTypeArguments
▸ changeGenericTypeArguments(genericTypeArguments): GenericType<T>
Changes the generic type arguments for this generic type and returns a new generic type instance with the new arguments where the types have been adjusted.
Since
0.12.0
Parameters
| Name | Type | Description |
|---|---|---|
genericTypeArguments |
T |
The new generic type arguments. |
Returns
GenericType<T>
Defined in
kipper/core/src/compiler/semantics/types/base/generic-type.ts:30
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