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.
W0xxx · Lexical & Syntax Errors
6 codesReported during tokenization or parsing when source bytes violate Wysna grammar.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W0001 | Unexpected Token | Invalid character or unexpected token in source stream. | No listed fix |
| W0002 | Malformed Number | Invalid integer, float, hex (0x), or binary (0b) literal syntax. | No listed fix |
| W0003 | Unterminated String | String or multiline triple-quoted string reached EOF without closing quote. | No listed fix |
| W0004 | Invalid Escape | Unsupported escape sequence inside string literal. | No listed fix |
| W0005 | Invalid Unicode Escape | Malformed Unicode scalar escape or unpaired surrogate. | No listed fix |
| W0006 | Syntax Error | Missing delimiter (}, ), ]) or malformed declaration/expression structure. | No listed fix |
W1xxx · Scope, Symbols & Modules
5 codesSymbol resolution, duplicate bindings, module graph resolution, and control-flow placement.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W1001 | Unknown Symbol | Identifier, type, field, or module symbol is not declared in scope. | machine (close typos) |
| W1002 | Duplicate Declaration | Symbol or parameter declared twice in the same lexical scope. | No listed fix |
| W1003 | Module Resolution Error | Imported module not found, invalid relative path, or circular import cycle. | No listed fix |
| W1004 | Invalid Control Flow | break, continue, or return used outside a valid loop or function body. | No listed fix |
| W1005 | Ambiguous Symbol | A short symbol selector has several candidates in semantic tooling. | No listed fix |
W2xxx · Type System & Pattern Matching
11 codesStatic type mismatches, exhaustiveness checks, generics, and native profile boundaries.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W2001 | Type Mismatch | Expression type does not match expected target, return, or operator type. | machine (str(...)) / maybe (?) |
| W2002 | Invalid Assignment Target | Left-hand side of assignment is not an assignable binding, field, or index. | No listed fix |
| W2003 | Non-Exhaustive Match | match expression misses one or more enum variants or required wildcard arm (_ =>). | No listed fix |
| W2004 | Invalid Return | Missing return path in non-unit function or return type conflict. | No listed fix |
| W2005 | Call / Generic Arity Error | Wrong argument count, non-callable target, or unsatisfied generic bound. | No listed fix |
| W2006 | Invalid Propagation / Else | Postfix ? or else err used on non-fallible/non-optional type or incompatible return channel. | No listed fix |
| W2007 | Invalid Struct Initializer | Missing required field or duplicate field in struct literal. | No listed fix |
| W2010 | Invalid Dict Key Type | Dictionary key type does not satisfy static hashable key contract. | No listed fix |
| W2013 | Native Profile Boundary | Construct is outside the self-hosted native-core-v1 profile; use Seed engine where applicable. | No listed fix |
| W2014 | Non-Isolated Worker Value | A CPU worker value includes unsupported references such as classes, Weak or native handles. | No listed fix |
| W2015 | Non-Isolated Worker Callback | A worker callback refers to an uncaptured global or crosses an unsupported isolation boundary. | No listed fix |
W3xxx · Mutability, Visibility & OOP Contracts
4 codesImmutability enforcement, visibility boundaries, interface conformance, and constructors.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W3001 | Immutable Assignment | Attempted to mutate a binding declared with let instead of let mut. | machine (let -> let mut) |
| W3002 | Private Member Access | Attempted to read or invoke a non-pub symbol across module or class boundaries. | No listed fix |
| W3003 | Interface / Inheritance Violation | Class fails to implement required interface method or violates override signature. | No listed fix |
| W3004 | Constructor / Init Violation | Misnamed class constructor (fn ClassName instead of fn init) or uninitialized field. | machine (fn init) |
W4xxx · Runtime Governance & Contracts
5 codesDeterministic runtime traps, execution budgets, and Design-by-Contract assertions.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W4001 | Division / Modulo by Zero | Checked integer or floating-point division/modulo by zero. | No listed fix |
| W4002 | Index / Key Out of Bounds | List index out of bounds or missing dictionary key on direct lookup. | No listed fix |
| W4003 | Runtime Invariant Failure | Explicit panic, failed forced unwrap (!), or runtime invariant check. | No listed fix |
| W4004 | Quota Exceeded | Execution exceeded --max-steps / WYSNA_MAX_STEPS or --max-heap-mb / WYSNA_MAX_HEAP_BYTES. | No listed fix |
| W4005 | Contract Violation | Function requires precondition or ensures postcondition evaluated to false. | No listed fix |
W5xxx · Toolchain, Concurrency & Policy
6 codesHost compiler invocation, optimistic patch hashing, and capability policy gates.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W5001 | Host Toolchain Missing | Required C99 compiler or native linker tool could not be located. | No listed fix |
| W5002 | Invalid CLI Usage | Unsupported command, invalid flag combination, or missing required argument. | No listed fix |
| W5003 | Source Read Failure | Source file or manifest cannot be read from disk. | No listed fix |
| W5004 | Artifact Write Failure | Failed to emit binary, C file, lockfile, or JSON artifact. | No listed fix |
| W5005 | Linker / Stale Revision Error | Native C compilation failed, or wysna patch/fix rejected a stale source SHA-256 / graph hash. | No listed fix |
| W5006 | Capability Policy Violation | Program violated --allow/--deny policy or compiled --sandbox WYSNA_DENY_CAP_* runtime guard. | No listed fix |
W6xxx · Static Analysis & Architecture
7 codesStatic warnings and checks for declared architecture rules.
| Code | Diagnostic | Description | Autofix |
|---|---|---|---|
| W6001 | Ambiguous Unary Minus | Newline followed by unary minus (let x = a\\n -b) may obscure operator binding. | No listed fix |
| W6002 | Potential ARC Retain Cycle | LayoutGraph detected a strong reference cycle between class types; prefer Weak[T]. | No listed fix |
| W6003 | Unreachable Match Arm | Earlier unguarded patterns already cover this match arm. | No listed fix |
| W6004 | Deprecated Call | A direct call targets a function marked @deprecated. | No listed fix |
| W6005 | Discarded Required Result | The return value of a function marked @must_use was discarded. | No listed fix |
| W6101 | Forbidden Architecture Dependency | A resolved dependency violates a declared architecture rule. | No listed fix |
| W6102 | Unverified Architecture Rule | The available dependency evidence could not verify a declared architecture rule. | No listed fix |