Skip to content

Sprig diagnostic codes (stable) ​

Generated from bin/sprig codes. Codes never change meaning; new behavior gets a new code. See also sprig explain <code>.

CodeMeaning
SPR-CLI-OPTIONA CLI command is missing a required argument or has an unknown option.
SPR-API-TARGETThe requested Sprig module or project API target cannot be resolved.
SPR-API-MEMBERThe requested --member does not exist on the inspected Sprig declaration.
SPR-CALL-ARITYWrong number of arguments.
SPR-CALL-DUPLICATE-FIELDThe same named field was provided twice.
SPR-CALL-MISSING-FIELDA required field was not provided.
SPR-CALL-NAMED-REQUIREDSprig class and variant constructors require named arguments.
SPR-CALL-POSITIONAL-REQUIREDFunctions and JVM calls require positional arguments.
SPR-CALL-UNKNOWN-FIELDNamed argument does not match any field.
SPR-COLLECTION-IMMUTABLEList/Map are read-only; convert with toMutableList()/toMutableMap().
SPR-FLOW-BREAKbreak is only valid inside a loop.
SPR-FLOW-CONTINUEcontinue is only valid inside a loop.
SPR-FLOW-MISSING-RETURNA non-Unit function must return on every path.
SPR-FLOW-THROWSA recoverable error must be declared with throws or caught.
SPR-FLOW-UNREACHABLEStatement follows a statement that always exits.
SPR-CONFORM-EFFECTSA witness method declares checked exceptions the Java interface method does not permit.
SPR-CONFORM-MEMBERAn existing class method does not exactly match a required abstract Java method.
SPR-CONFORM-OVERLOADThe Java interface requires overloaded abstract methods, which Sprig classes cannot represent.
SPR-CONFORM-SOURCEThe conform source must be a non-generic Sprig class declared in this module.
SPR-CONFORM-TARGETThe conform target must be an imported public, non-generic, non-sealed Java interface.
SPR-JVM-AMBIGUOUSThe Java overload is ambiguous for these argument types.
SPR-JVM-CLASSThe imported Java class could not be loaded, or it lives in the unnamed package.
SPR-JVM-CLASSPATHA --classpath entry is empty, missing, or not a JAR/directory.
SPR-JVM-COMPILEThe generated Java source did not compile; may be a compiler bug.
SPR-JVM-INTERNALInternal compiler or tooling failure.
SPR-JVM-MEMBERNo Java method/constructor/field matches this call.
SPR-LEX-CHARThe input contains a character outside the Sprig lexer.
SPR-LEX-INDENT-FIRSTThe first code line of a file must start at column 1.
SPR-LEX-INDENT-INCONSISTENTA dedent must return to a previous indentation level.
SPR-LEX-STRINGA string literal is unterminated or contains an invalid escape.
SPR-LEX-TABTabs are forbidden; Sprig indentation uses spaces only.
SPR-LEX-UNCLOSEDA '(' '[' or '{' was opened and never closed.
SPR-LEX-UNMATCHEDA closing delimiter has no matching opener.
SPR-MATCH-DUPLICATEA match branch repeats a case.
SPR-MATCH-ENUM-BINDERPayloadless enum cases cannot bind 'as name'.
SPR-MATCH-INFERENCEAn expression match needs an explicit result type because its branches establish no non-null type.
SPR-MATCH-NONEXHAUSTIVEEvery enum/variant case must have a match branch; there is no default.
SPR-MATCH-RESULTAn expression-match branch has an incompatible result type.
SPR-MATCH-SCRUTINEEmatch requires a non-nullable enum or variant value.
SPR-MATCH-UNKNOWN-CASEThe case name does not exist on the matched type.
SPR-MATCH-WRONG-TYPEA match branch belongs to a different enum/variant.
SPR-MODULE-EXPORTA declaration reexport names an unknown or illegal target, or conflicts with a visible name.
SPR-MODULE-EXPORT-ORDERImports, declaration reexports and ordinary definitions are out of order.
SPR-NAME-DUPLICATETwo declarations share one name in one namespace.
SPR-NAME-DUPLICATE-MEMBERA class/variant declares the same member twice.
SPR-NAME-FIELD-SHADOWA parameter/local cannot shadow a current-class field.
SPR-NAME-IMPORTAn imported file or class cannot be resolved.
SPR-NAME-IMPORT-CYCLESprig modules form an import cycle.
SPR-NAME-LET-ASSIGNlet bindings and let fields cannot be reassigned.
SPR-NAME-MODULEModule import/alias problem.
SPR-NAME-NOT-A-TYPEA value name was used where a type is required.
SPR-NAME-NOT-A-VALUEA type or module name was used as a value.
SPR-NAME-UNRESOLVEDA name has no declaration in the current scope chain.
SPR-NUM-RANGEA numeric literal is outside its target range or underflows to zero.
SPR-NUM-CONVERSIONAn implicit numeric conversion risks precision or range loss.
SPR-NUM-DIVISIONInteger/BigInt / would truncate, or Decimal / lacks a rounding policy.
SPR-NUM-MIXEDA numeric operator cannot implicitly mix these numeric families.
SPR-RUNTIME-ERRORUncaught Sprig Error value at runtime; the wrapped message, origin data and source range are reported.
SPR-WRAP-CHECKGenerated Java-to-Sprig wrapper source failed Sprig checking or formatting.
SPR-RUNTIME-EXCEPTIONUncaught JVM exception at runtime, wrapped to a Sprig-level message with a source range; run --stacktrace restores the raw JVM stack.
SPR-PROGRAM-EXITThe Sprig program exited with a non-zero process status.
SPR-SYNTAX-ERRORThe token sequence does not match the Sprig grammar.
SPR-TYPE-ASSIGNAssignment value does not match the target type.
SPR-TYPE-FUNCTION-ARITYFunction types and lambdas support zero to three explicitly typed parameters.
SPR-TYPE-CAPTUREA lambda captures a var local; copy it into a let binding first.
SPR-TYPE-CONDITIONConditions must be Bool; Sprig has no truthiness.
SPR-TYPE-INFERThe type cannot be inferred without an annotation.
SPR-TYPE-MISMATCHExpected and actual types are not compatible.
SPR-TYPE-NOT-CALLABLEThe callee is not callable (or a method name was used as a value).
SPR-TYPE-NULLnull is only assignable to an explicit nullable type T?.
SPR-TYPE-NULLABLEA possibly-null value is used where non-null is required; check for null first.
SPR-TYPE-OPERANDOperator or method is not defined for this operand type.
SPR-TYPE-RETURNReturned value does not match the declared return type.
SPR-TYPE-UNITUnit is only a function/method result; it cannot be a field, parameter, collection element, or ordinary value.
SPR-TYPE-GENERIC-ARITYA generic declaration was used with the wrong number of type arguments (supply every parameter in declaration order).
SPR-TYPE-GENERIC-ARGS-REQUIREDA generic function or constructor needs explicit [Type] arguments; Sprig does not infer them.
SPR-TYPE-GENERIC-NULLABLEThis type parameter is used with ? in the declaration, so its argument must be non-nullable.
SPR-GENERIC-CONSTRAINTAn unsupported capability was requested; the implementation supports Equatable only, not Comparable.
SPR-PROJECT-MANIFESTsprig.toml is missing, malformed, or lacks a required field.
SPR-PROJECT-ENTRYThe project entry point is missing or the named --bin is unknown.
SPR-PROJECT-UNSUPPORTEDThe project or a dependency needs project features or a language version this compiler does not support.
SPR-PROJECT-LOCK-MISSINGThis project has no sprig.lock; run sprig resolve.
SPR-PROJECT-LOCK-STALECompiler identity, sprig.toml or a dependency manifest differs from sprig.lock; run sprig resolve.
SPR-PROJECT-LOCK-SCHEMAThe lockfile schema version is not supported.
SPR-PROJECT-NOT-EXPORTEDA module imported from a dependency is not in its exports.
SPR-DEP-CYCLESprig project dependencies form a cycle.
SPR-DEP-NOT-FOUNDA declared Sprig dependency or module cannot be found.
SPR-DEP-GITA Git dependency operation failed. Cache-lock contention waits up to five seconds, then asks the user to retry; it never steals a lock.
SPR-DEP-OFFLINEA required dependency resource is missing from the cache in offline mode.
SPR-DEP-CHECKSUMLocked dependency bytes do not match SHA-256; corrupted cache is rejected.
SPR-DEP-MAVENA JVM (Maven) dependency operation failed.

Optional structured fields ​

Diagnostic JSON keeps the stable fields (code, phase, severity, uri, range, message, related, suggestedEdits) and may add optional fields:

FieldMeaning
expectedType / actualTypeRendered types involved in a mismatch.
hintOne short human instruction.
relatedHelpHelp topic accepted by sprig help <topic>.
repair{ "kind": ..., "machineApplicable": bool } repair strategy.

machineApplicable is true only for a correction that is semantics-preserving and unambiguous. When it is false, treat repair.kind as a strategy, not a patch: for example a nullable value needs an explicit narrow/handle decision, which is business logic the compiler must not invent. sprig explain <CODE> --json returns the same repair object plus causes, safe fixes and examples.

Declaration facade errors ​

  • SPR-MODULE-EXPORT: unknown/illegal target or duplicate/colliding visible name; includes origin names.
  • SPR-MODULE-EXPORT-ORDER: imports, exports, declarations/statements must appear in that order.
  • Existing SPR-NAME-IMPORT-CYCLE also rejects reexport chains containing a cycle.

Function signatures ​

  • SPR-SYNTAX-ERROR reports a throws clause without a declared result type with explicit guidance (-> Unit throws Error), a hint to add the result type and the functions help topic.

Expression match results ​

  • SPR-MATCH-RESULT: incompatible branch result; expected/actual types and match repair guidance.
  • SPR-MATCH-INFERENCE: no non-null type can be inferred; annotate explicitly.
  • Existing SPR-MATCH-*, null/numeric/capture/effect diagnostics also apply.
  • SPR-SYNTAX-ERROR rejects empty/multi-statement/declaration branches, with statement-match guidance where the parser retains branch context.
  • SPR-TYPE-UNIT rejects side-effect-only expression matches.

Sprig is licensed under Apache-2.0 · v0.5.0-beta.1 published as a prerelease