Ballerina library
lang.typedesc
Module lang.typedesc
ballerina/lang.typedesc Ballerina library
2201.9.0
Module overview
The lang.typedesc
module corresponds to the typedesc
basic type.
Functions
typeIds
Isolated Function
Returns the type-ids induced by a typedesc value.
type Error distinct error; type SampleError distinct (Error & error<record {string msg;}>); Error.typeIds() ⇒ [{"moduleId":{"organization":"$anon","name":".","platformParts":["0"]},"localId":"Error"}] SampleError.typeIds() ⇒ [{"moduleId":{"organization":"$anon","name":".","platformParts":["0"]},"localId":"SampleError"},{"moduleId":{"organization":"$anon","name":".","platformParts":["0"]},"localId":"Error"}] SampleError.typeIds(true) ⇒ [{"moduleId":{"organization":"$anon","name":".","platformParts":["0"]},"localId":"SampleError"}]
Parameters
- t typedesc - the typedesc
- primaryOnly boolean (default false) - if true, only the primary type-ids will be returned; otherwise, all type-ids will be returned
Return Type
- readonly & TypeId[]? - an array containing the type-ids induced by
t
or nil ift
is not definite
Records
lang.typedesc: ModuleId
Read OnlyClosed record
A record representing an identifier for a module. This uniquely identifies a module within a program.
Fields
- organization string - the organization
- name string - the module name
- platformParts string[] - platform-specified parts of the identifier
lang.typedesc: TypeId
Read OnlyClosed record
A record representing a type-id. A type-id uniquely identifies an occurrence of a distinct type descriptor within a program.
Fields
- moduleId ModuleId - An identifier for the module.