Silk Effect
@silk-lang/language

Silk diagnostic index

Every diagnostic code the Silk compiler can report, with its meaning.

Each code is stable: it identifies one condition and never changes meaning between releases. The prefix names the compiler phase that reports it. Regenerate this page with:

$ pnpm --filter @silk-lang/compiler documentation:generate
PrefixPhaseCodes
LEXLexical7
PARParser4
MODModule3
SEMSemantic155
OWNOwnership16
LAYLayout1

There are 186 codes in total.

Lexical (LEX)

CodeMeaningReported as
LEX0001Stable diagnostic code for a maximal unsupported byte region.Unsupported byte sequence
LEX0002Stable code for an identifier-like modifier outside the closed literal vocabulary.Unknown static-literal modifier: <modifier>
LEX0003Stable code for a literal whose matching closing delimiter is absent.Unterminated <subject> literal
LEX0004Stable code for an integer-literal base prefix that no digit follows.Base-<radix> integer literal without digits
LEX0005Stable code for a number-literal digit separator outside a position between two digits.Digit separator must sit between two digits
LEX0006Stable code for a float-literal exponent marker that no exponent digit follows.Float literal exponent must have at least one digit
LEX0007Stable code for a character literal that denotes a number of scalars other than one.Character literal must hold exactly one Unicode scalar, but holds <scalars>

Parser (PAR)

CodeMeaningReported as
PAR0001Stable code for one required token that is absent at its insertion position.Expected <describeexpected>
PAR0002Stable code for one maximal region of unexpected concrete tokens.Unexpected <encountered>; expected valid syntaxUnexpected <encountered>; expected <expectation>Unexpected <encountered> while parsing a statementUnexpected <encountered> while parsing a <context>
PAR0003Stable code for a primary-expression template start reserved for future support.Template syntax is reserved but not implemented
PAR0004Stable code for an import whose reserved final path segment cannot form an implicit binding.Reserved module segment <spelling> requires an explicit alias or selected-member list

Module (MOD)

CodeMeaningReported as
MOD0001Stable code for an import naming a module absent from the supplied sources.Unknown module <module>
MOD0002Stable code for an import redundantly naming its own containing module.Module <module> imports itself
MOD0004Stable code for a user module claiming the reserved standard-library namespace.Module <module> claims the reserved standard-library namespace silk/; user modules must live outside it

Semantic (SEM)

CodeMeaningReported as
SEM0001Stable code for a present return-type name that is not a bootstrap built-in.Unknown type <spelling>
SEM0002Stable code for a present decimal literal outside the positive i32 range.Integer literal exceeds the i32 range
SEM0003Stable code for a present declaration name repeated after its first occurrence.Duplicate declaration name <spelling>
SEM0004Stable code for a present call name with no matching top-level declaration.Unknown function <spelling>
SEM0005Stable code for a present parameter name repeated after its first occurrence.Duplicate parameter name <spelling>
SEM0006Stable code for a present value name with no matching local declaration.Unknown value <spelling>
SEM0007Stable code for a uniquely resolved call with the wrong number of arguments.Expected <expectedCount> <expectedCount1argumentarguments> but received <actualCount>
SEM0008Stable code for a binding whose name repeats a parameter or an earlier binding.Cannot rebind <spelling>
SEM0009Stable code for a qualified call naming an unknown built-in actor.Unknown actor <spelling>
SEM0010Stable code for a known actor called with an unknown operation name.<actor> has no operation <spelling>
SEM0011Stable code for a conditional whose condition is not bool.Condition must be bool, found <actual>
SEM0012Stable code for a call argument whose type mismatches its parameter.Expected <expected> but received <actual>
SEM0014Module <module> has no member <spelling>
SEM0015<module>.<spelling> is private
SEM0016Multiple bindings claim <spelling>
SEM0017Duplicate field name <spelling>
SEM0018Expected a type, found <spelling>
SEM0019Public declaration exposes private type <type>
SEM0020Inline recursive struct layout: <join>
SEM0021Cannot construct <type> because its raw constructor is not available at this site
SEM0022<type> has no field <field>
SEM0023Field <field> is initialized more than once
SEM0024Missing initializer for <type>.<field>
SEM0025Field <field> expects <expected> but received <actual>
SEM0026Cannot project a field from <actual>
SEM0027<type> has no field <field>
SEM0028<type>.<field> is private
SEM0029An empty array literal needs an expected Array type
SEM0030Array element <index> expects <expected> but received <actual>
SEM0031Array literal expects <expected> elements but received <actual>
SEM0032Cannot index <actual>
SEM0033Array index must be usize, found <actual>
SEM0034Array index <index> is outside length <length>
SEM0035Cannot assign through immutable binding <spelling>
SEM0036Assignment requires a writable binding, field, or indexed place
SEM0037Assignment expected <expected> but received <actual>
SEM0038<transfer> is only valid inside a loop
SEM0039Structural union members must be detached ordinary values with finite storage, found <type>
SEM0040<source> cannot widen to <target>; missing <join>
SEM0041Cannot match non-nominal type <actual>
SEM0042<member> is not a member of <scrutinee>
SEM0043Unreachable match arm <member>
SEM0044Match does not cover <join>
SEM0045Match guard must be bool, found <actual>
SEM0046Pattern for <type> is missing field <field>; add it or use ..
SEM0047Pattern field <field> appears more than once
SEM0048Pattern binding <spelling> conflicts with an existing declaration
SEM0049Match arms have incompatible result types: <join>
SEM0050Duplicate type parameter <spelling>
SEM0051<target> expects <expected> type argument<expected1s>, received <actual>
SEM0052Cannot infer all type arguments for <target> from supplied values
SEM0053Recursive specialization changes type arguments from <caller> to <target>
SEM0054Stable code for a borrowed view outside an allowed direct type position.A borrowed view must be the complete type of an ordinary function parameterA borrowed view cannot appear in a <position> type
SEM0055A borrowed view is not valid in this expression position
SEM0056A borrowed view requires a direct stable owner or borrowed view
SEM0057Exclusive borrowing requires mutable binding <spelling>
SEM0058A shared slice cannot be reborrowed exclusively
SEM0059Passing an array as <expected> requires an explicit borrow
SEM0060Stable code for a negative decimal literal contextualized as unsigned usize.usize literals cannot be negative
SEM0061Stable code for a type that cannot inhabit an Effect failure channel.Effect failure <type> must be a detached ordinary value type
SEM0062Stable code for a failure channel attached to an ordinary function.Only effect functions may declare a failure channel
SEM0063Only effect functions may originate a typed failure
SEM0064Failure <type> is not declared by this effect function
SEM0065Cannot run non-effect value <type>
SEM0066Run leaves unhandled failures: <join>
SEM0067Invalid Effect.catch handler: <detail>
SEM0068Effect recipe bindings are immutable
SEM0070Stable code for a non-concrete or non-nominal capability in a requirement row.Effect requirement <type> must be one concrete service type
SEM0071Run leaves unsatisfied requirements: <join>
SEM0073Failure <type> is not detached because it contains a lexical borrow
SEM0074Invalid Effect provider: <detail>
SEM0075Cannot call non-callable value <actual>
SEM0076Callable <actual> cannot satisfy <expected>
SEM0077Callable invocation requires <toLowerCase> access
SEM0078<target> is unary; name it directly instead of calling it with no arguments
SEM0080Cannot merge callable values from different construction sites without explicit erasure
SEM0081Cannot return an owned callable whose concrete environment identity is unknown
SEM0082Stable code for a raw storage operation outside lexical unsafe authority.<operation> requires unsafe acknowledgement
SEM0083Stable code for an invalid source-declared capability implementation.Invalid conformance: <detail>
SEM0084Stable code for a Drop implementation outside the compiler-sealed hook contract.Invalid Drop hook: <detail>
SEM0085Stable code for malformed escapes, invalid UTF-8, or non-byte literal values.Invalid static literal: <detail>
SEM0086Stable code for a typed constant whose type or literal is outside the constant contract.Invalid constant: <detail>
SEM0087Stable code for an expression statement whose result cannot be intentionally ignored.Expression statement produces <actual>, but only () or never may be ignored
SEM0088Stable code for using a generic binder in a value, failure-row, or requirement-row position of another kind.Generic parameter <spelling> has kind <actual>, expected <expected>
SEM0089Stable code for a failure or requirement row that cannot be finitely decomposed.Failure type does not contain selected member <member>Requirement row does not contain &mut <capability>@<role>Requirement row does not contain &<capability>@<role>Requirement <capability> has role <joinor>, expected <expected>Requirement <capability>@<role> has access <joinor>, expected <expected>Requirement row remainder is ambiguous across <join>Requirement row specialization is not finite and concrete
SEM0090Stable code for storage, bodies, or defaults inside a source service contract.Invalid service declaration: <detail>
SEM0091A returned borrowed view must belong to an ordinary function with exactly one borrowed parameter; an exclusive result requires an exclusive parameter
SEM0092The returned borrowed view does not originate from the function's single borrowed parameter
SEM0093Stable code for one reachable intrinsic unavailable on the requested execution target.<operation> is unavailable for <target>
SEM0095Stable code for a float literal spelling no floating-point value can represent.Invalid float literal: <spelling>
SEM0097Stable code for a bound operation call whose receiver names more than one bounded parameter.<spelling> is ambiguous across bounded type parameters <join>
SEM0099Stable code for one named type parameter left undetermined by an explicit prefix and the arguments.Cannot infer type argument <parameter> of <target> from supplied values
SEM0100Stable code for an explicit type argument contradicting the type its value arguments imply.Type argument <parameter> of <target> is <written>, but the supplied values imply <implied>
SEM0101Stable code for a bound operation whose selected witness has no lowering.<spelling> has no witness that can be lowered for <provider>
SEM0103Stable code for constructing an aggregate that stores a bare callable value.Cannot construct <aggregate>: <site> retains the static identity of <callable>, but represented callable storage has no supported runtime layoutCannot construct <aggregate>: <site> would store the callable <callable>, whose environment layout depends on a hidden concrete identity that <aggregate> does not carry
SEM0104Stable code for the first struct initializer that contradicts an inferred representation.Representation <parameter> was inferred as <expected>, but this initializer uses <actual>
SEM0105Stable code for the first exact representation that diverges at a static value join.Cannot join <expected> with <actual>; consume each represented value inside its branch before joining
SEM0106Stable code for a representation argument whose contract cannot satisfy its required bound.Representation <parameter> requires <required>, but the supplied bound <actual> is not admissible
SEM0107Stable code for storing a represented Effect before its runtime layout is supported.Cannot construct <aggregate>: <site> retains the static identity of <effect>, but represented Effect storage has no supported runtime layout
SEM0108Stable code for a typeof item that resolves to no declaration in scope.Cannot name the exact representation of <item>: no declaration of that name is in scope
SEM0109Stable code for a typeof item whose name belongs to more than one declaration.Cannot name the exact representation of <item>: <count> declarations carry that name, so no single item is resolved
SEM0110Stable code for a typeof item that names something other than an ordinary callable.Cannot name the exact representation of <item>: it names <subject>, which has no source-nameable exact identity
SEM0111Stable code for a typeof item whose generic parameters are not all supplied.Cannot name the exact representation of <item>: an exact representation names one construction, but <expected> generic parameters were declared and <actual> concrete arguments were supplied
SEM0112Stable code for a public contract exposing the exact identity of a private item.Public contract exposes the exact representation of private <item>
SEM0113Stable code for one opaque producer specialization yielding multiple exact identities.Opaque result <family> has divergent reachable realizations: <join>
SEM0114Stable code for an opaque family whose representation evidence contains no local construction.Opaque realization cycle has no local concrete construction: <join>
SEM0115Stable code for an opaque realization whose inline captures contain that same family.Opaque results form an infinite inline layout cycle: <join>
SEM0116Stable code for an opaque result binder whose bound is not callable or Effect representation.Opaque result binder <binder> must have a callable or Effect representation bound, but its kind is <actual>
SEM0117Stable code for an opaque producer whose reachable returns establish no representation.Opaque result <family> has no reachable callable or Effect representation construction
SEM0118Stable code for an opaque result declared where no producer body can establish its identity.Opaque result <declaration> is not permitted on a <context> operation because no producer body can establish one static representation
SEM0119Stable code for two conformance heads that may name one provider under one interface.<head> may overlap <other>
SEM0120Stable code for a conformance requirement that does not descend toward a base witness.<head> declares a requirement that does not descend
SEM0121Stable code for a concrete specialization whose conditional requirements cannot be proved.<goal> cannot be proved: <detail>
SEM0122Stable code for a complete application that reaches the instance frontier with open rows or evidence.<declaration> reaches a complete application with unresolved contract rows or evidence
SEM0123Stable code for a provider that matches no member of its concrete source requirement row.The provider matches no compatible requirement
SEM0124Stable code for provider relations sharing a selector but retaining disjoint candidate sets.Provider constraints select incompatible requirement members
SEM0125Stable code for provider selection that retains more than one common requirement member.The provider matches more than one requirement; select one explicitly
SEM0126Stable code for an explicitly or independently selected row that is not exactly one member.Selected requirement row has <count> members; exactly one is required
SEM0127Stable code for a surviving provider candidate with more than one conformance witness.More than one conformance witness can provide the selected requirement
SEM0128Stable code for a surviving provider candidate whose conformance mapping is invalid.The provider's conformance mapping is invalid: <reason>
SEM0129Stable code for an explicit return whose value violates the declaration result.Return expected <expected> but received <actual>
SEM0130Stable code for a reachable non-unit function fallthrough.A reachable path must return <expected>
SEM0131Stable code for a provider whose key matches but whose access cannot satisfy the requirement.<toLowerCase> provider access cannot satisfy an <toLowerCase> requirement
SEM0132Stable code for an Effect join whose alternatives cannot be represented as a finite composite.Cannot form a finite Effect join: <detail>
SEM0133Stable code for a refutable pattern in an unconditional local binding.Let pattern is refutable for <actual>; it does not cover <join>. Use if let or match
SEM0134Stable code for an operator marker that cannot describe its interface operation.Invalid operator contract: <detail>
SEM0135Stable code for operator syntax with no marked operation accepting its operands.Operator <operator> does not accept (<join>)
SEM0136Stable code for operator syntax matched by more than one marked operation.Operator <operator> is ambiguous between <join>
SEM0137Stable code for an unsafe acknowledgement that does not complete an unsafe invocation.`unsafe` must acknowledge a complete unsafe invocation
SEM0138Stable code for a statically known allocation/layout specialization mismatch.Local-shared allocation was planned for <actual>, not <expected>
SEM0139Stable code for a concrete executable that fails one sealed static-property obligation.<property> is unsatisfied: <join>
SEM0140Stable code for an externally parking entry with no explicit Execution owner.External parking requires an explicit Intrinsic.Execution owner
SEM0141Stable code for an ordinary capability conjoined with one exact executable bound.<conjunct> is not a sealed executable property
SEM0142Stable code for a statically known execution-package allocation/layout mismatch.Execution allocation was planned for <actual>, not <expected>
SEM0143Stable code for mut where no mutable owned parameter storage exists.`mut` declares function-local owned parameter storage and is not valid in a service or interface contract`mut` declares mutable owned parameter storage; use `&mut` for exclusive borrowed access
SEM0144Stable code for applying a callable whose borrowed result has no exact source identity.A callable returning a borrowed view requires one unchanged exact function or section identity
SEM0145Stable code for mutating an outer callable from a deferred effect recipe.A deferred effect cannot mutate captured callable binding <spelling>
SEM0146Stable code for a scalar enum with no declared members.Enum <enumName> must declare at least one member
SEM0147Stable code for a scalar enum representation outside the fixed-width integer set.<spelling> is not a scalar enum representation
SEM0148Stable code for a scalar enum member name repeated after its first declaration.Duplicate enum member name <spelling>
SEM0149Stable code for a scalar enum discriminant repeated after its first declaration.Duplicate enum discriminant <value>
SEM0150Stable code for an explicit scalar enum discriminant outside its representation range.Enum discriminant <value> is outside <representation>
SEM0151Stable code for an implicit scalar enum successor outside its representation range.Implicit enum discriminant after <predecessor> exceeds <representation>
SEM0152Stable code for a negative discriminant under an unsigned scalar enum representation.Unsigned enum representation <representation> cannot hold <value>
SEM0153Stable code for a member missing from a resolved scalar enum.Enum <enumName> has no member <member>
SEM0154Stable code for a canonical member used through or required by another enum.Enum member of <actual> cannot be used as <expected>
SEM0155Stable code for implicit mixing between a scalar enum and an integer.<integer> does not implicitly construct <enumName><enumName> does not implicitly convert to <integer>
SEM0156Stable code for equality between distinct canonical scalar enums.Equality requires one enum type, not <left> and <right>
SEM0157Stable code for direct ordering of scalar enum values.Enum <enumName> does not support <operator>; compare backing values explicitly
SEM0158Stable code for a scalar enum match that leaves canonical members uncovered.Match over <enum> does not cover <join>
SEM0159Stable code for a repeated unguarded scalar enum member arm.Duplicate enum match arm <member>
SEM0160Stable code for a scalar enum arm following an unguarded wildcard.Enum match arm is unreachable after `_`
SEM0161Stable code for a scalar enum pattern naming a member of another enum.Enum pattern from <actual> cannot match <expected>
SEM0162Stable code for an integer literal pattern used against a scalar enum.Integer pattern <value> cannot match enum <enum>
SEM0163Stable code for effect-block return sites whose success types disagree.Effect block return sites have incompatible types: <join>

Ownership (OWN)

CodeMeaningReported as
OWN0001Stable code for a use of a binding after its consuming move.<spelling> was moved and cannot be used again
OWN0002Struct fields cannot be moved independently
OWN0003Moving <spelling> requires an explicit move
OWN0004Assignment to <spelling> consumes the same owner before replacement commits
OWN0005Loop <loop> repeats with incompatible owner liveness
OWN0006Borrowed pattern binding <spelling> cannot escape its match arm
OWN0007Exclusive match requires mutable binding <spelling>
OWN0008Match guard cannot consume pattern binding <spelling>
OWN0009<access> match requires a complete binding place
OWN0010<requested> borrowed-view loan conflicts with an active <toLowerCase> loan
OWN0011<toLowerCase> access to <spelling> conflicts with an active borrowed-view loan
OWN0012A non-Copy value cannot be moved out through a borrowed-view place
OWN0014Stable code for invoking a stored callable through too weak an aggregate receiver access.Cannot invoke field <field> of <aggregate> through <toLowerCase> aggregate access: <contract> requires <toLowerCase> access to the whole aggregate
OWN0015Stable code for running a stored Effect through too weak an aggregate receiver access.Cannot run field <field> of <aggregate> through <toLowerCase> aggregate access: <contract> requires <toLowerCase> access to the whole aggregate
OWN0016Stable code for an access-scoped local-shared borrow escaping or crossing suspension.Local-shared access cannot suspend while its exclusive borrow is liveLocal-shared access cannot invoke an external readiness callback while its exclusive borrow is liveLocal-shared access callback cannot return a value that retains its exclusive borrow
OWN0017Stable code for an owner consumed in only some arms of a branch merge.Branches merge with incompatible owner liveness for <spelling>

Layout (LAY)

CodeMeaningReported as
LAY0001Stable code for an exact usize magnitude outside the selected target word.usize literal <spelling> exceeds the <bits>-bit range for <target>

See also

On this page