(class)
public abstract sealed Type
{inherits
TypeInfo}
The abstract representation of a Curl® type.
| can-be-null?: | true if this type admits null as a value. Otherwise false. |
field public-get hidden-set Type.can-be-null?:
bool
| class?: | true if this type is a class (has methods). Otherwise false. |
accessor public final inline Type.class?:
bool
accessor public sealed Type.keyword-type-parameters:{
FastArray-of KeywordTypeParameter}
| kind-of-units: | The KindOfUnits (physical or graphic dimensions) represented by this type. Interesting only if this type is numeric. |
accessor public final Type.non-null-variant:#
Type
accessor public final Type.null-variant:#
Type
accessor public sealed Type.positional-type-parameters:{
FastArray-of PositionalTypeParameter}
| primitive?: | true if this type is primitive: numeric, char, bool, any, or void. Otherwise false. |
accessor public final Type.primitive?:
bool
field public-get hidden-set Type.takes-rest-args?:
bool
| template: | The template for this type if it is parameterized. Otherwise null. |
|
public abstract sealed
| {Type.subtype-of? t:Type}:bool |
(field)
public-get hidden-set Type.can-be-null?:
bool true if this type admits null as a value. Otherwise false.
Description
This is true for the type #T, read T or null
.
Notes
(accessor)
accessor public final inline Type.class?:
bool true if this type is a class (has methods). Otherwise false.
Notes
(accessor)
accessor public sealed Type.keyword-type-parameters:{
FastArray-of KeywordTypeParameter}
(accessor)
The KindOfUnits (physical or graphic dimensions) represented by this type. Interesting only if this type is numeric.
Notes
(accessor)
accessor public final Type.non-null-variant:#
Type The non-null variant of this type.
Description
The non-null variant of #T is T.
(accessor)
accessor public final Type.null-variant:#
Type The null variant of this type.
Description
The null variant of T is #T. Otherwise it is T.
(accessor)
accessor public sealed Type.positional-type-parameters:{
FastArray-of PositionalTypeParameter}
(accessor)
accessor public final Type.primitive?:
bool true if this type is primitive: numeric, char, bool, any, or void. Otherwise false.
(field)
public-get hidden-set Type.takes-rest-args?:
bool true if this is a ProcType that accepts rest (...) arguments. Otherwise false.
Notes
(accessor)
The template for this type if it is parameterized. Otherwise null.
Notes
(method)
| public abstract sealed
| {Type.subtype-of? t:Type}:bool |
Determines if self is a subtype of a specified Type
t: The
Type with which you want to compare
self.
Returns
A
bool. This method returns
true if
self is a subtype
t. Otherwise, it returns
false.
Description
self is a subtype of t if any instance of the self type can be stored in a variable of type t without requiring a change of representation.
Notes
Note the following:
- Every type is its own subtype.
- All types are subtypes of the type any.
- All types created using define-class are subtypes of their direct and indirect base classes (including Object).
- Every type t is a subtype of its null variant type #t.
- Integer types are not considered subtypes of larger integer types, even if their values fit, because they don't have the same representation. For instance, int8 is not a subtype of int, because their representations use different numbers of bits.
Notes
Also see documentation for the
isa operator.