tobogganSe connecter

louise

The Louise language: compiler, runtime, std, tooling

Clone avec HTTPS, un jeton personnel en mot de passe, ou avec SSH, une clé ajoutée dans vos paramètres.

91 lignes · 15384 octetsBrut · Historique

Diagnostic codes

Every diagnostic carries a stable code.

CodePhaseMeaning
E0001syntaxSyntax 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.
E0101namesNo value with this name is in scope, or a module has no such item.
E0102namesNo type, trait or effect with this name is in scope. An unknown lowercase name in a type is a type variable, not an error.
E0103namesNo module with this path exists, or a qualifier is not an imported module.
E0104namesThe item exists but is not pub.
E0105namesImports form a cycle. Modules must import each other acyclically.
E0106namesTwo definitions or imports share a name in one module and namespace.
E0107namesA pub function, @extern function, trait method or effect operation lacks a parameter type or return type. These signatures form module interfaces (ADR 0001).
E0108namesPattern bindings are invalid in one of these ways: a name bound twice, or-pattern alternatives binding different names, or a misplaced ...
E0109namesA module, type or non-constructor is used where a value or constructor is expected.
E0110literalsAn integer literal is outside the 63-bit literal range (larger Ints are computed), or a tuple index is too large.
E0111literalsAn invalid escape in a string literal.
E0112effectsA handler clause names something that is not an effect operation.
E0113effectsAn @extern function's callback parameter breaks a rule of ADR 0015: it may perform <ffi> 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.
E0114namesAn 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).
E0115namesA function without a body that is neither @extern nor a trait method, or an @extern function with a body.
E0116namesA misplaced _ placeholder (ADR 0023): 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 _).
E0117namesA 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).
E0118namesopaque on a type without pub, on an alias, or on a type without a body.
E0119namesA 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).
E0120namesAn associated type defined in its trait (there are no defaults), or declared without = type in an impl (ADR 0047).
E0121namesA binding of an associated type after something that is not a trait: a<Elem = Int>.
E0122namesAn effect alias refers to itself, through its members or directly (ADR 0044).
E0123namesAn 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).
E0124namesAn effect alias applied to type arguments; aliases take none.
E0126namesAn item that is not a @test function uses a module imported with @test import (ADR 0064); reported once, at the item.
E0125namesA label written with the wrong sigil (ADR 0062): a function's labelled argument is f ~name: x (no parentheses, ~ not :); a constructor's fields keep name:, never ~name:.
W0101namesA 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.
W0102namesAn 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).
E0201typesA 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.
E0202typesType mismatch: the expected type and the found type differ.
E0203typesA type must be known at this point (field or tuple access on a value of unknown type); add an annotation.
E0204typesInvalid 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).
E0205typesToo 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).
E0206typesNo such field: unknown label, a type with no fields, or a type with several constructors.
E0207typesCalling something that is not a function.
E0208typesA type alias refers to itself.
E0209typesInference would need an infinite type (a = List<a>).
E0210typesA trait or effect is used where a type is expected.
E0211typesA type variable is not declared as a parameter of its type or alias.
E0212traitsExpected a trait constraint such as Show<a>, with one type per trait parameter.
E0213typesKind mismatch: a type constructor where a type is expected or the reverse (Show<f> with f<a> 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.
E0214typesA 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).
E0215typesA refined constructor (GADT or existential, ADR 0041) is taken apart outside a match arm of its own (a let, a parameter, an alternative of `
E0216typesA 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).
E0401traitsA type does not implement a required trait. For <>, the trait is Semigroup (ADR 0027): the note lists the types that implement it.
E0402traitsA signature's type variable needs a where constraint. Also: a signature uses a projection Elem<c> without where Container<c> (ADR 0047).
E0403traitsAmbiguous: 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<c> does not determine c), or an equality on a projection that nothing decides (its arguments stay unknown).
E0404traitsTwo impls of the same trait for the same named types (they overlap).
E0405traitsOrphan impl: neither in the trait's module nor in the module of one of its types.
E0406traitsAn impl defines a method or an associated type its trait does not declare.
E0407traitsAn impl lacks a method or an associated type its trait declares.
E0408traits@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).
E0409traitsAn impl is not of the form impl Trait<Type<a, b>, ...>: one named type (applied to type variables) or one tuple of type variables per trait parameter, with all the variables distinct.
E0410traitsDeriving fails because a field's type lacks the trait.
E0411traitsA trait has no type parameter, or the same one twice.
E0412traitsAn 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>) -> R. Only Eq, Ord, Hash and Default may omit the function.
E0413traitsAn impl of Send or Wire: the compiler decides them from the type's structure (ADR 0004, Revision 6; ADR 0072), so they cannot be implemented.
E0414traitsAn effect operation's where clause requires a trait other than Send: performing an operation passes no dictionary.
E0415traitsAn impl's definition of an associated type is invalid (ADR 0047): 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).
E0416traitsAn invalid binding of an associated type (Container<c, Elem = Int>, ADR 0047): 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.
E0301patternsNon-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).
E0302patternsA refutable pattern where every value must match: let, or function or lambda parameters.
W0301patternsAn unreachable arm: earlier arms match every value it matches.
E0501effectsA handler handles more than one effect, or no operation at all.
E0502effectsA 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).
W0501effectsA 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.)
E0504effectsA handler does not handle every operation of its effect.
E0505effectsAn invalid effect row: a label that is not an effect, a row variable that is not last, or an operation declaring its own row.
E0506effectsA 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).
E0601htmlA pug template is malformed (ADR 0057); 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.)
E0602htmlAn attribute value is not a String, Int, Bool or Option<String>.
E0603htmlAn event attribute (on*): reserved for the client target.
E0604htmlA component argument written without a value.
E0605htmlOne of std's templaters (pug, html, xml) used as a value; they are compiled syntax and only tag a template literal (ADR 0057).
E0701regionsA reference created in a region would escape it, through the region's value or a variable defined outside.
E0702regionsA user handler for alloc or st: only region { } handles references.
E0703handlersA 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).
E0704actorsA value cannot be sent to another actor (Send, ADR 0004, 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<b>. The note says which field.
E0705typesA 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).
E0706distributionA value cannot cross hosts (Wire, ADR 0072): 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.
E0707distributionA @remote function of the wrong shape (ADR 0072): generic, not one argument, a result other than (), or an effect nothing handles around an actor (only proc, clock, random, io and ffi). Its argument's type is checked by E0706.
E0708distributionTwo @remote functions whose qualified names hash to the same key (a 62-bit hash: rename one).
E0801packagesThe 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.
E0901in placeA 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). Reported by louise check, run, build and test, and by the language server, after the other errors are fixed.