Skip to content

Appendix B: Diagnostic Code Index ​

A user-facing cheat sheet of diagnostic codes. For compiler implementation details, see docs/3_SemanticAnalysis.md.

Current version: SYX 117.0 · Phase 139 · documentation fingerprint diag-139 (compiler source is authoritative)

Semantics (S series) ​

CodeMeaning
S001Duplicate symbol definition
S002Undefined identifier
S003Assignment to an immutable variable
S004Type mismatch
S005Cross-module access to an internal / private / fileprivate symbol
S006Iterator protocol missing next()
S007Sealed / exhaustiveness related (switch missing a case)
S008Type narrowing (e.g. Int64 → Int8)
S009Signed/unsigned mixing (partial)
S010Does not conform to the protocol / generic where constraint not satisfied
S011Borrow / mutation violation
S012Associated type error
S013Collection type consistency
S014Signed / unsigned mixing
S015Does not conform to the Hashable protocol
S016Does not conform to the Equatable protocol
S017Lifetime violation
S019Sendable channel
S020MainActor violation after await / guard let else does not exit / await in a non-async context
S022Using SIMD while it is disabled
S024Collection hosted ops forbid the legacy MethodCall (Phase 48)
S025Semantic-layer hosted methods must go through an extension / CallHost (Phase 50)
S046is with a numeric target forbidden (1 is Int and similar)
S050Inheritance override validation related (missing override / not declared in the superclass / signature mismatch)
S051override keyword missing
S052override of something not declared in the superclass
S053Inheriting a final class
S054override signature mismatch
S055override of a final superclass method
S056Computed property observers (rejected)

Host Plugins (H series) ​

CodeMeaning
H001Plugin not loaded or plugin Host does not exist
H002Compile-time plugin manifest inconsistent with runtime / lock file
H003Plugin ABI version mismatch
H004Plugin min_syx_version not satisfied

Lexical (L series) ​

CodeMeaning
L001Unterminated string / invalid lexical element (lexer)
L002–L012Lint rules (see 9_UsageGuide)

Lint excerpts:

CodeMeaning
L001Function names should start lowercase (lint)
L002Duplicate function name
L003Empty function body
L004A public function should declare a return type
L005An async function should use await
L006Illegal character (variable name)
L007Global variable missing initialization
L008Empty import name
L009Bare return
L010Line longer than 120 characters
L011Contains TODO/FIXME
L012Prefer structured logging over print

Syntax (P series) ​

CodeMeaning
P001Parse error (illegal syntax)
P001syx.lock missing at compile time (manifest not installed)

Runtime (R series) ​

CodeMeaning
R003as! failure; Array / String subscript out of bounds; integer narrowing out of range
R007Force-unwrapping nil with !
R008readLine failure
R011Integer overflow Display (≠ GA; current arithmetic always wraps). The same code may also be used by other domains (such as the HTTP client)
R012Integer division by zero
R013URL parsing failure
R014Recursion too deep (stack overflow)
R016Required field not initialized

Concurrency (A / C series) ​

CodeMeaning
A002Actor isolation violation
A003GlobalActor related
C001Actor isolation violation (finer-grained)
C002distributed actor boundary
C003Passing a non-Sendable type across isolation
C004Task cancellation related
C005GlobalActor violation after await
C006Structured concurrency parent task cancellation propagation
C009Actor synchronous same-instance reentrancy rejected (serial-no-reenter)
C010Channel closed (post-close send)

Macros (E / W series) ​

CodeMeaning
W001#warning triggered
E001#error triggered
E002Macro expansion depth exceeded or cyclic expansion
E003Role misplacement (e.g. @freestanding(expression) used in statement position)
E004external macro during WASM compilation (SYX_TARGET_WASM=1)
E006@Service / @Component used on a non-type
E007Dependency cycle without @Lazy
E008@Inject missing dependency
E010DI typed resolve with a dynamic variable

Borrow Machine Proofs ​

PhaseTrigger
Phase 32+SYX_BORROW_MACHINE_PROOF=1 enables proof obligation export
Phase 33+SYX_BORROW_COQ_LEAN_EXPORT=1 enables Coq/Lean export
Phase 34+SYX_BORROW_COQ_LEAN_PROOF_PROD=1 prod machine checking

Full Toolchain Diagnostics ​

See docs/9_UsageGuide.md — Diagnostic Codes.


See also → Language Reference: About This Reference · Implementation Status Master Table · docs/3_SemanticAnalysis.md

SYX · Apache-2.0