meta.language.types
19 anchors
| Anchor | Implementation | Tests |
|---|---|---|
| meta.language.types (19) | 19 Implemented | 19 Implemented |
argument_arity | Implemented | Implemented |
Each named type application must supply exactly the declared number of type arguments. This applies to opaque types, built-in types, parameters, and nested applications; a type parameter takes zero arguments. | ||
declaration_prose | Implemented | Implemented |
A struct or enum can carry triple-quoted prose immediately inside its opening brace. The parsed declaration retains that text; omitting it is permitted. | ||
enum_variants | Implemented | Implemented |
An | ||
field_prose | Implemented | Implemented |
A named field can carry triple-quoted prose immediately before its name. The parsed field retains that text independently of the containing declaration or variant’s prose. At the start of a body, the first prose string describes the container; a description for its first field follows as a second string. | ||
generic_parameters | Implemented | Implemented |
Structs, enums, and opaque types can declare a nonempty comma-separated list of type parameters in angle brackets. Parameters are available throughout their own declaration and do not become names in other declarations. | ||
member_commas | Implemented | Implemented |
Adjacent named fields, enum variants, and tuple payload elements require a comma separator. A trailing comma before the closing delimiter is optional. For example:
| ||
name_resolution | Implemented | Implemented |
An unqualified type name resolves first to a parameter of its declaration, then to a type, class, or context in the same module, then to the built-in prelude. An earlier match shadows a later one. | ||
opaque_representation | Implemented | Implemented |
An opaque | ||
prelude | Implemented | Implemented |
The built-in prelude contains | ||
qualified_names | Implemented | Implemented |
A type outside the current module requires a | ||
recursive_values | Implemented | Implemented |
Semantic value types can refer directly to themselves or to each other, without
| ||
struct_fields | Implemented | Implemented |
A | ||
tuples | Implemented | Implemented |
Parentheses always denote a tuple, including | ||
type_expressions | Implemented | Implemented |
Type expressions are named types with optional generic arguments, or tuples. Generic arguments and tuple elements are themselves type expressions, allowing arbitrary nesting. The parsed expression retains that nesting. | ||
unique_fields | Implemented | Implemented |
Named fields have distinct names within a struct or a single enum variant. Different declarations and different variants may reuse field names. | ||
unique_parameters | Implemented | Implemented |
A value declaration cannot repeat a type parameter’s name. | ||
unique_variants | Implemented | Implemented |
Variants have distinct names within an enum. Different enums may reuse a variant name. | ||
unknown_names | Implemented | Implemented |
Every type name in a value field, variant payload, class or context field, or method result must resolve. An unknown name is an error even when nested in generic arguments or tuples. | ||
variant_prose | Implemented | Implemented |
A variant can carry triple-quoted prose immediately inside its payload’s opening delimiter, or immediately after a unit variant’s name. The parsed variant retains that text independently of other variants. | ||