Home / Docs / Diagnostics

U0103: Reserved keyword not available in the package's edition

Release v0.4.0

A reserved word is used as a keyword or as a name. The message names the planned area, "reserved for a later edition (laws)" for example, or the Una construct to use instead.

Why Una rejects it

Some words are reserved for features planned in later versions of Una, and others name constructs from other languages that Una expresses differently. Using one as a keyword or as a name is rejected (spec/01 §5). For example, Una has no return: the last expression of a body is its result.

In edition 0.3 the test declaration is written test (ADR 0105), so example at the start of a declaration is U0103 there, "example is written test in edition 0.3". The declaration's body is read as a test's, and editions 0.1 and 0.2 keep example.

How to fix it

The repair at a glance

diff
  module demo

- pub double(x: Int) -> Int = return x * 2
+ pub double(x: Int) -> Int = x * 2

Failing example

una
module demo

pub double(x: Int) -> Int = return x * 2

Fixed example

una
module demo

pub double(x: Int) -> Int = x * 2