Types
TypeUse = SimpleTypeUse
| ArrayTypeUse
;
SimpleTypeUse = Identifier
;
ArrayTypeUse = "[" , TypeUse , ";" , NumberLiteral , "]"
;
Types define the shape of values within a program.
Every expression, local and global variable, constant has an associated type.
There are four main categories of types:
- Primitive types
- User-defined structure types (
structtypes) - Array types
- Function pointer types
Primitive types
- Numbers
u1u2(requiresnarrow-intpreview feature enabled)u4(requiresnarrow-intpreview feature enabled)u8u16i8i16
neverunit
Array types
i.e. [ItemType; Count]
User-defined structure types (struct types)
See Structs
Function pointer types
See Functions