Class: BuiltInTypeFunc
compiler.BuiltInTypeFunc
Represents the built-in type Func.
Since
0.12.0
Hierarchy
GenericBuiltInType<BuiltInTypeFuncGenericArguments>↳
BuiltInTypeFunc
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new BuiltInTypeFunc(paramTypes, returnType)
Parameters
| Name | Type |
|---|---|
paramTypes |
ProcessedType[] |
returnType |
ProcessedType |
Overrides
GenericBuiltInType.constructor
Defined in
kipper/core/src/compiler/semantics/types/built-in/func.ts:28
Properties
_identifier
• Protected Readonly _identifier: string
Inherited from
GenericBuiltInType._identifier
Defined in
kipper/core/src/compiler/semantics/types/base/type.ts:9
genericTypeArguments
• Readonly genericTypeArguments: BuiltInTypeFuncGenericArguments
The generic type arguments for this type.
Since
0.12.0
Inherited from
GenericBuiltInType.genericTypeArguments
Defined in
kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:16
interchangeableTypes
▪ Static Readonly interchangeableTypes: string[]
Inherited from
GenericBuiltInType.interchangeableTypes
Defined in
kipper/core/src/compiler/semantics/types/base/built-in-type.ts:13
Accessors
identifier
• get identifier(): string
The identifier of this type.
Returns
string
Inherited from
GenericBuiltInType.identifier
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:19
isCompilable
• get isCompilable(): boolean
Returns whether the type is compilable.
Since
0.12.0
Returns
boolean
Overrides
GenericBuiltInType.isCompilable
Defined in
kipper/core/src/compiler/semantics/types/built-in/func.ts:45
isGeneric
• get isGeneric(): true
Returns whether the type is a generic type.
This is ALWAYS true, since this is a generic type.
Since
0.12.0
Returns
true
Inherited from
GenericBuiltInType.isGeneric
Defined in
kipper/core/src/compiler/semantics/types/base/generic-built-in-type.ts:35
isUnion
• get isUnion(): boolean
Returns whether the type is a union type.
Since
0.12.0
Returns
boolean
Inherited from
GenericBuiltInType.isUnion
Defined in
kipper/core/src/compiler/semantics/types/base/processed-type.ts:46
paramTypes
• get paramTypes(): ProcessedType[]
Returns the parameter types of the function.
Since
0.12.0
Returns
Defined in
kipper/core/src/compiler/semantics/types/built-in/func.ts:61
returnType
• get returnType(): ProcessedType
Returns the return type of the function.
Since
0.12.0
Returns
Defined in
kipper/core/src/compiler/semantics/types/built-in/func.ts:53
Methods
assertAssignableTo
▸ assertAssignableTo(type, propertyName?, argumentName?): void
Asserts that this type is assignable to another type.
This will check for generic type arguments as well.
Pasram
type The type to check against.
Throws
AssignmentTypeError If the types are not assignable.
Throws
PropertyAssignmentTypeError If a property is not assignable.
Throws
ArgumentAssignmentTypeError If an argument is not assignable.
Since
0.12.0
Parameters
| Name | Type | Description |
|---|---|---|
type |
ProcessedType |
- |
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
Overrides
GenericBuiltInType.assertAssignableTo
Defined in
kipper/core/src/compiler/semantics/types/built-in/func.ts:69
changeGenericTypeArguments
▸ changeGenericTypeArguments(genericTypeArguments): BuiltInTypeFunc
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 |
BuiltInTypeFuncGenericArguments |
The new generic type arguments. |
Returns
Overrides
GenericBuiltInType.changeGenericTypeArguments
Defined in
kipper/core/src/compiler/semantics/types/built-in/func.ts:65
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
GenericBuiltInType.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
GenericBuiltInType.isAssignableTo
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