OxL Reference

§3. Types

OxL is statically typed. Type inference is local: the parameter types and the return types of pub/pub(api) functions MUST be given; for private functions the return type MAY be inferred.

In this chapter

3.1 PrimitivesInteger arithmetic.
3.2 Strings and bytesStrings and bytes
3.3 Composite typesA literal [a, b] has type List<T> unless the context requires [T; N] or [T].
3.4 Declared typesdata — a product type with named fields (§4.2).
3.5 Unions and optionalsA | B — an anonymous union.
3.6 Aliases, new types and refined typesdistinct T creates a new nominal type with the representation of T.
3.7 References and ownership qualifiersRules — §7.
3.8 Asynchronous and stream typesAsynchronous and stream types
3.9 Copy and moveCopy types: primitives, str, bytes, Duration, Time and other time types, distinct/refined types over a Copy type, tuples and arrays of Copy types, and data/enum with @derive(Copy) all of whose fields are Copy.

cannot-infer, missing-annotation

See also

Source: docs/spec/oxl-standard.en.md