# Diagnostic codes Every diagnostic carries a stable code. | Code | Phase | Meaning | |---|---|---| | `E0001` | syntax | Syntax error. The message names what was expected and what was found. Parsing always continues, so later errors may be consequences of earlier ones. Only the first error at any given position is reported. | | `E0101` | names | No value with this name is in scope, or a module has no such item. | | `E0102` | names | No type, trait or effect with this name is in scope. An unknown *lowercase* name in a type is a type variable, not an error. | | `E0103` | names | No module with this path exists, or a qualifier is not an imported module. | | `E0104` | names | The item exists but is not `pub`. | | `E0105` | names | Imports form a cycle. Modules must import each other acyclically. | | `E0106` | names | Two definitions or imports share a name in one module and namespace. | | `E0107` | names | A `pub` function, `@extern` function, trait method or effect operation lacks a parameter type or return type. These signatures form module interfaces ([ADR 0001](../adr/0001-language-surface.md)). | | `E0108` | names | Pattern bindings are invalid in one of these ways: a name bound twice, or-pattern alternatives binding different names, or a misplaced `..`. | | `E0109` | names | A module, type or non-constructor is used where a value or constructor is expected. | | `E0110` | literals | An integer literal is outside the 63-bit literal range (larger `Int`s are computed), or a tuple index is too large. | | `E0111` | literals | An invalid escape in a string literal. | | `E0112` | effects | A handler clause names something that is not an effect operation. | | `E0113` | effects | An `@extern` function's callback parameter breaks a rule of [ADR 0015](../adr/0015-c-callbacks-and-bindings.md): it may perform `` at most (closed row), a `blocking` extern takes none, an extern whose callback performs `ffi` performs `ffi` too, and a function reaches C only as a parameter itself. | | `E0114` | names | An invalid attribute: an unknown name, `@extern` option or ABI, malformed arguments (such as an `@extern` without a symbol string), an attribute given twice, or one on an item it does not apply to (`@derive` on a function, `@should_panic` without `@test`, `@remote` on an `@extern` function, any attribute on a method). | | `E0115` | names | A function without a body that is neither `@extern` nor a trait method, or an `@extern` function with a body. | | `E0116` | names | A misplaced `_` placeholder ([ADR 0023](../adr/0023-pipe-placeholders-and-capture.md)): more than one in a call, one with a `..` spread, one in a `use` call, or `_` used as an expression anywhere but directly as a call's argument (`f a _`, `x \|> f a _`). | | `E0117` | names | A constructor or field of an opaque type used outside the type's module: imported, called (record update included), matched, or read with `.field` ([ADR 0033](../adr/0033-opaque-types.md)). | | `E0118` | names | `opaque` on a type without `pub`, on an alias, or on a type without a body. | | `E0119` | names | A `return` that can't leave the function from where it is: inside a lambda, a capture (`f a _`), a handler clause or a `defer` cleanup ([ADR 0037](../adr/0037-early-return.md)). | | `E0120` | names | An associated type defined in its trait (there are no defaults), or declared without `= type` in an impl ([ADR 0047](../adr/0047-associated-types.md)). | | `E0121` | names | A binding of an associated type after something that is not a trait: `a`. | | `E0122` | names | An effect alias refers to itself, through its members or directly ([ADR 0044](../adr/0044-effect-row-ergonomics.md)). | | `E0123` | names | An effect alias's member is not an effect or an effect alias, or no effect of that name is in scope where the alias is declared (members resolve there, issue #322). | | `E0124` | names | An effect alias applied to type arguments; aliases take none. | | `E0126` | names | An item that is not a `@test` function uses a module imported with `@test import` ([ADR 0064](../adr/0064-test-only-code.md)); reported once, at the item. | | `E0125` | names | A label written with the wrong sigil ([ADR 0062](../adr/0062-parens-free-functions.md)): a function's labelled argument is `f ~name: x` (no parentheses, `~` not `:`); a constructor's fields keep `name:`, never `~name:`. | | `W0101` | names | A local binding takes the name of an imported module: `module.item` then reads a field of the local, not an item of the module (issue #297). Rename the local, or the import with `as`. The field error such an access fails with names the binding too. | | `W0102` | names | An import nothing uses: no `module.item` access resolves through it, and no item it imports by name is referred to. A module used only in types or effect rows, or a trait named by `@derive`, still counts as used (issue #297). | | `E0201` | types | A type is applied to the wrong number of type arguments: too many, too few where a type is expected, or too few for an alias. | | `E0202` | types | Type mismatch: the expected type and the found type differ. | | `E0203` | types | A type must be known at this point (field or tuple access on a value of unknown type); add an annotation. | | `E0204` | types | Invalid labels: an unknown label, an argument given twice, labels on an unnamed callee, or a malformed record update. A record update `Ctor(..base, ...)` on a type with several constructors is E0204 too (issue #150). | | `E0205` | types | Too many arguments or pattern fields, a constructor given the wrong number of fields, or an argument missing its declared `~` label. Too *few* arguments is not an error: the call is a partial application ([ADR 0062](../adr/0062-parens-free-functions.md)). | | `E0206` | types | No such field: unknown label, a type with no fields, or a type with several constructors. | | `E0207` | types | Calling something that is not a function. | | `E0208` | types | A type alias refers to itself. | | `E0209` | types | Inference would need an infinite type (`a = List`). | | `E0210` | types | A trait or effect is used where a type is expected. | | `E0211` | types | A type variable is not declared as a parameter of its type or alias. | | `E0212` | traits | Expected a trait constraint such as `Show`, with one type per trait parameter. | | `E0213` | types | Kind mismatch: a type constructor where a type is expected or the reverse (`Show` with `f` elsewhere), a type variable applied in one place and not in another, an impl argument of the wrong kind for its trait, or a row variable used as a type. | | `E0214` | types | A refined constructor's `-> T` is not its own type applied to as many types as it has parameters, or its type has a parameter that is not a type (an effect row or a type constructor) ([ADR 0041](../adr/0041-gadts-and-existentials.md)). | | `E0215` | types | A refined constructor (GADT or existential, ADR 0041) is taken apart outside a `match` arm of its own (a `let`, a parameter, an alternative of `|`), or read with `.field` or updated with `..base`: use `match`. | | `E0216` | types | A constructor called like a function (`User a b`): construction is not application — a constructor takes its fields in parentheses, `User(a, b)`, and there is no partial construction ([ADR 0062](../adr/0062-parens-free-functions.md)). | | `E0401` | traits | A type does not implement a required trait. For `<>`, the trait is `Semigroup` (ADR 0027): the note lists the types that implement it. | | `E0402` | traits | A signature's type variable needs a `where` constraint. Also: a signature uses a projection `Elem` without `where Container` ([ADR 0047](../adr/0047-associated-types.md)). | | `E0403` | traits | Ambiguous: no type determines which impl to use; add an annotation. Also reported at declarations: a `where` variable that appears nowhere else in the signature, or a trait method that does not mention every parameter of its trait. Also: a variable that appears only inside projections (`Elem` does not determine `c`), or an equality on a projection that nothing decides (its arguments stay unknown). | | `E0404` | traits | Two impls of the same trait for the same named types (they overlap). | | `E0405` | traits | Orphan impl: neither in the trait's module nor in the module of one of its types. | | `E0406` | traits | An impl defines a method or an associated type its trait does not declare. | | `E0407` | traits | An impl lacks a method or an associated type its trait declares. | | `E0408` | traits | `@derive` names something that is not a trait marked `@derivable`, or a trait that cannot be derived for this type: `Default` for a type with several constructors, or for an opaque type ([ADR 0033](../adr/0033-opaque-types.md)). | | `E0409` | traits | An impl is not of the form `impl Trait, ...>`: one named type (applied to type variables) or one tuple of type variables per trait parameter, with all the variables distinct. | | `E0410` | traits | Deriving fails because a field's type lacks the trait. | | `E0411` | traits | A trait has no type parameter, or the same one twice. | | `E0412` | traits | An invalid `@derivable`: the trait does not have one parameter and one method `fn m(x: a) -> R`, or the derive function is missing or not of type `fn(Constructor) -> R`. Only `Eq`, `Ord`, `Hash` and `Default` may omit the function. | | `E0413` | traits | An impl of `Send` or `Wire`: the compiler decides them from the type's structure ([ADR 0004](../adr/0004-actor-model.md), Revision 6; [ADR 0072](../adr/0072-distribution.md)), so they cannot be implemented. | | `E0414` | traits | An effect operation's `where` clause requires a trait other than `Send`: performing an operation passes no dictionary. | | `E0415` | traits | An impl's definition of an associated type is invalid ([ADR 0047](../adr/0047-associated-types.md)): defined twice, with the wrong number of parameters, or with a projection whose reduction might not end (a projection inside it must take the impl's own type variables as its trait's arguments). | | `E0416` | traits | An invalid binding of an associated type (`Container`, [ADR 0047](../adr/0047-associated-types.md)): outside the `where` clause of a function or a constructor, with the wrong number of parameters, bound twice to different types, with a parameter named like one of the signature's type variables, referring to itself, or contradicting the impl. | | `E0301` | patterns | Non-exhaustive `match`. The message shows a value no arm matches. Arms with guards do not count as covering. A `match` with no arms is exhaustive only on a type with no values (`Never`, or a GADT none of whose constructors fits). | | `E0302` | patterns | A refutable pattern where every value must match: `let`, or function or lambda parameters. | | `W0301` | patterns | An unreachable arm: earlier arms match every value it matches. | | `E0501` | effects | A handler handles more than one effect, or no operation at all. | | `E0502` | effects | A call performs an effect the current row does not allow: the enclosing function's signature, or no enclosing handler. Also an early `return` from a callback whose effects are fixed by the type it is passed as (ADR 0037). | | `W0501` | effects | A written row lists an effect the body never performs. The row is the function's contract — a caller supplies a handler for every label in it — so dead members are drift; remove them. (Issue #203.) | | `E0504` | effects | A handler does not handle every operation of its effect. | | `E0505` | effects | An invalid effect row: a label that is not an effect, a row variable that is not last, or an operation declaring its own row. | | `E0506` | effects | A `defer` cleanup performs an effect whose operations could unwind or suspend (a user effect, `proc`), or calls code whose effects are not known. Cleanups may use `io`, `ffi` and references (ADR 0016). | | `E0601` | html | A `pug` template is malformed ([ADR 0057](../adr/0057-compiled-std-templaters.md)); the message names the template's line and what it expected. (The code's earlier use — an untyped child hole — is retired: such a child is shown with `Show`, [ADR 0034](../adr/0034-string-interpolation.md).) | | `E0602` | html | An attribute value is not a `String`, `Int`, `Bool` or `Option`. | | `E0603` | html | An event attribute (`on*`): reserved for the client target. | | `E0604` | html | A component argument written without a value. | | `E0605` | html | One of std's templaters (`pug`, `html`, `xml`) used as a value; they are compiled syntax and only tag a template literal ([ADR 0057](../adr/0057-compiled-std-templaters.md)). | | `E0701` | regions | A reference created in a region would escape it, through the region's value or a variable defined outside. | | `E0702` | regions | A user handler for `alloc` or `st`: only `region { }` handles references. | | `E0703` | handlers | A handler would be used outside its scope: a value or variable defined outside the `handle` mentions it, or an operation refers to a handler that is no longer visible (ADR 0010). Typically a callback called inside a function's own handler without a declared type. Also a callback that can `return` from the enclosing function escaping its `use` (ADR 0037). | | `E0704` | actors | A value cannot be sent to another actor (`Send`, [ADR 0004](../adr/0004-actor-model.md), Revision 6): it holds a `Ref`, a `Resource` whose kind is not `@thread_safe`, or a value of a type its constructor hides without `where Send`. The note says which field. | | `E0705` | types | A type a matched constructor hides (an existential), or knows only in its arm, would escape the `match` arm: through the arm's result or a variable defined outside it (ADR 0041). | | `E0706` | distribution | A value cannot cross hosts (`Wire`, [ADR 0072](../adr/0072-distribution.md)): it holds a function, a `Ref`, a `Resource` (even `@thread_safe`), a `Dynamic`, a `Builder`, a foreign type, an associated type, a value of a type whose constructor stores a dictionary or hides or refines a type (ADR 0041), or of a nested (non-regular) type. The note says which field. | | `E0707` | distribution | A `@remote` function of the wrong shape ([ADR 0072](../adr/0072-distribution.md)): generic, not one argument, a result other than `()`, or a disallowed effect (only `proc`, `clock`, `random`, `io` and `ffi` are admitted; host `fs` is denied even for the otherwise-uniform local actor row by [ADR 0084](../adr/0084-capability-roots.md)). Its argument's type is checked by `E0706`. | | `E0708` | distribution | Two `@remote` functions whose qualified names hash to the same key (a 62-bit hash: rename one). | | `E0801` | packages | The package cannot be loaded: its `louise.toml`, or a dependency's, is invalid, or its dependencies cannot be resolved from the lockfile and the git cache. Reported by the language server, in the manifest at fault; `louise` reports the same problems as errors before checking. | | `E0901` | in place | A function marked `@fip` allocates: it builds a cell that reuses none of the values it matched (or one whose size is not known), makes a closure, calls a function value or a function that allocates, performs or handles an effect, or calls an extern that allocates ([ADR 0040](../adr/0040-perceus-v2.md)). Reported by `louise check`, `run`, `build` and `test`, and by the language server, after the other errors are fixed. |