ES
Tooling & InternalsCompiler · ABI v3

Diagnostic Error Code Index (Wxxxx)

Search common Wysna compiler and runtime diagnostic codes, find their causes, and see which cases wysna fix can repair.

The compiler and runtime use Wxxxx codes to identify diagnostics. Use wysna check --output-format=json-v1 to read the code and source span from a structured report. See the language specification for the diagnostic taxonomy.

When wysna fix --apply supports an error code, repairs are verified against exact UTF-8 byte spans and source SHA-256 hashes before modifying disk.


44 codes

W0xxx · Lexical & Syntax Errors

6 codes

Reported during tokenization or parsing when source bytes violate Wysna grammar.

CodeDiagnosticDescriptionAutofix
W0001Unexpected TokenInvalid character or unexpected token in source stream.No listed fix
W0002Malformed NumberInvalid integer, float, hex (0x), or binary (0b) literal syntax.No listed fix
W0003Unterminated StringString or multiline triple-quoted string reached EOF without closing quote.No listed fix
W0004Invalid EscapeUnsupported escape sequence inside string literal.No listed fix
W0005Invalid Unicode EscapeMalformed Unicode scalar escape or unpaired surrogate.No listed fix
W0006Syntax ErrorMissing delimiter (}, ), ]) or malformed declaration/expression structure.No listed fix

W1xxx · Scope, Symbols & Modules

5 codes

Symbol resolution, duplicate bindings, module graph resolution, and control-flow placement.

CodeDiagnosticDescriptionAutofix
W1001Unknown SymbolIdentifier, type, field, or module symbol is not declared in scope.machine (close typos)
W1002Duplicate DeclarationSymbol or parameter declared twice in the same lexical scope.No listed fix
W1003Module Resolution ErrorImported module not found, invalid relative path, or circular import cycle.No listed fix
W1004Invalid Control Flowbreak, continue, or return used outside a valid loop or function body.No listed fix
W1005Ambiguous SymbolA short symbol selector has several candidates in semantic tooling.No listed fix

W2xxx · Type System & Pattern Matching

11 codes

Static type mismatches, exhaustiveness checks, generics, and native profile boundaries.

CodeDiagnosticDescriptionAutofix
W2001Type MismatchExpression type does not match expected target, return, or operator type.machine (str(...)) / maybe (?)
W2002Invalid Assignment TargetLeft-hand side of assignment is not an assignable binding, field, or index.No listed fix
W2003Non-Exhaustive Matchmatch expression misses one or more enum variants or required wildcard arm (_ =>).No listed fix
W2004Invalid ReturnMissing return path in non-unit function or return type conflict.No listed fix
W2005Call / Generic Arity ErrorWrong argument count, non-callable target, or unsatisfied generic bound.No listed fix
W2006Invalid Propagation / ElsePostfix ? or else err used on non-fallible/non-optional type or incompatible return channel.No listed fix
W2007Invalid Struct InitializerMissing required field or duplicate field in struct literal.No listed fix
W2010Invalid Dict Key TypeDictionary key type does not satisfy static hashable key contract.No listed fix
W2013Native Profile BoundaryConstruct is outside the self-hosted native-core-v1 profile; use Seed engine where applicable.No listed fix
W2014Non-Isolated Worker ValueA CPU worker value includes unsupported references such as classes, Weak or native handles.No listed fix
W2015Non-Isolated Worker CallbackA worker callback refers to an uncaptured global or crosses an unsupported isolation boundary.No listed fix

W3xxx · Mutability, Visibility & OOP Contracts

4 codes

Immutability enforcement, visibility boundaries, interface conformance, and constructors.

CodeDiagnosticDescriptionAutofix
W3001Immutable AssignmentAttempted to mutate a binding declared with let instead of let mut.machine (let -> let mut)
W3002Private Member AccessAttempted to read or invoke a non-pub symbol across module or class boundaries.No listed fix
W3003Interface / Inheritance ViolationClass fails to implement required interface method or violates override signature.No listed fix
W3004Constructor / Init ViolationMisnamed class constructor (fn ClassName instead of fn init) or uninitialized field.machine (fn init)

W4xxx · Runtime Governance & Contracts

5 codes

Deterministic runtime traps, execution budgets, and Design-by-Contract assertions.

CodeDiagnosticDescriptionAutofix
W4001Division / Modulo by ZeroChecked integer or floating-point division/modulo by zero.No listed fix
W4002Index / Key Out of BoundsList index out of bounds or missing dictionary key on direct lookup.No listed fix
W4003Runtime Invariant FailureExplicit panic, failed forced unwrap (!), or runtime invariant check.No listed fix
W4004Quota ExceededExecution exceeded --max-steps / WYSNA_MAX_STEPS or --max-heap-mb / WYSNA_MAX_HEAP_BYTES.No listed fix
W4005Contract ViolationFunction requires precondition or ensures postcondition evaluated to false.No listed fix

W5xxx · Toolchain, Concurrency & Policy

6 codes

Host compiler invocation, optimistic patch hashing, and capability policy gates.

CodeDiagnosticDescriptionAutofix
W5001Host Toolchain MissingRequired C99 compiler or native linker tool could not be located.No listed fix
W5002Invalid CLI UsageUnsupported command, invalid flag combination, or missing required argument.No listed fix
W5003Source Read FailureSource file or manifest cannot be read from disk.No listed fix
W5004Artifact Write FailureFailed to emit binary, C file, lockfile, or JSON artifact.No listed fix
W5005Linker / Stale Revision ErrorNative C compilation failed, or wysna patch/fix rejected a stale source SHA-256 / graph hash.No listed fix
W5006Capability Policy ViolationProgram violated --allow/--deny policy or compiled --sandbox WYSNA_DENY_CAP_* runtime guard.No listed fix

W6xxx · Static Analysis & Architecture

7 codes

Static warnings and checks for declared architecture rules.

CodeDiagnosticDescriptionAutofix
W6001Ambiguous Unary MinusNewline followed by unary minus (let x = a\\n -b) may obscure operator binding.No listed fix
W6002Potential ARC Retain CycleLayoutGraph detected a strong reference cycle between class types; prefer Weak[T].No listed fix
W6003Unreachable Match ArmEarlier unguarded patterns already cover this match arm.No listed fix
W6004Deprecated CallA direct call targets a function marked @deprecated.No listed fix
W6005Discarded Required ResultThe return value of a function marked @must_use was discarded.No listed fix
W6101Forbidden Architecture DependencyA resolved dependency violates a declared architecture rule.No listed fix
W6102Unverified Architecture RuleThe available dependency evidence could not verify a declared architecture rule.No listed fix