Skip to content

Error Reference

This section documents all typesugar diagnostic codes in the TS9xxx range. Each error includes an explanation of the problem and common fixes.

Quick Reference

Use the --explain CLI flag to get detailed information about any error code:

bash
npx typesugar --explain TS9001

Error Code Ranges

RangeCategoryDescription
TS9001-TS9099Typeclass ResolutionErrors related to summon(), @instance, @derive, implicit resolution
TS9101-TS9199Derive FailuresErrors when auto-deriving typeclass instances
TS9201-TS9299Macro SyntaxSyntax errors in macro usage
TS9301-TS9399HKTHigher-kinded type errors
TS9401-TS9499Extension MethodsErrors with standalone extension methods
TS9501-TS9599ComptimeCompile-time evaluation errors
TS9701-TS9799Import ResolutionImport and module resolution errors
TS9801-TS9899OperatorsOperator overloading errors
TS9901-TS9999InternalInternal compiler errors

Typeclass Resolution Errors (TS9001-TS9099)

  • TS9001 - No instance found for typeclass
  • TS9002 - Ambiguous typeclass instances
  • TS9003 - Invalid @instance declaration
  • TS9004 - Instance type mismatch
  • TS9005 - Missing type arguments for summon
  • TS9006 - Instance already exists (warning)
  • TS9007 - Typeclass not found
  • TS9008 - Invalid extends clause

Import Suggestions (TS9060-TS9069)

  • TS9060 - Typeclass not in scope (with import suggestion)
  • TS9061 - Macro not defined (with import suggestion)
  • TS9062 - Extension method not found for type (with import suggestion)
  • TS9063 - Import suggestion hint (info)

Derive Errors (TS9101-TS9199)

  • TS9101 - Cannot derive for type
  • TS9102 - Missing field instance
  • TS9103 - Unsupported field type
  • TS9104 - Circular derivation
  • TS9105 - Field requires custom instance (warning)

Macro Syntax Errors (TS9201-TS9299)

  • TS9201 - Invalid macro argument count
  • TS9202 - Invalid macro argument type
  • TS9203 - Invalid target for decorator
  • TS9204 - Missing type arguments
  • TS9205 - Invalid expression
  • TS9206 - Invalid block expression
  • TS9207 - Not a compile-time constant
  • TS9208 - Invalid type annotation
  • TS9209 - Invalid function signature
  • TS9210 - Unknown derive
  • TS9211 - Cannot specialize
  • TS9212 - Static assert failed
  • TS9213 - Not tail recursive
  • TS9214 - Invalid cfg condition
  • TS9215 - Generic field extraction failed
  • TS9216 - Invalid contract
  • TS9217 - Method not found
  • TS9218 - Unused derive (warning)
  • TS9219 - Invalid reflect target
  • TS9220 - Module graph error
  • TS9221 - Custom derive error

HKT Errors (TS9301-TS9399)

  • TS9301 - Invalid HKT parameter (phantom type)
  • TS9302 - HKT kind mismatch
  • TS9303 - @hkt type alias must contain _ placeholder
  • TS9304 - @hkt must contain exactly one _ placeholder
  • TS9305 - Cannot resolve type constructor for @impl

Extension Method Errors (TS9401-TS9499)

  • TS9401 - Extension method not found
  • TS9402 - Ambiguous extension method
  • TS9403 - Invalid extension registration

Comptime Errors (TS9501-TS9599)

  • TS9501 - Comptime evaluation failed
  • TS9502 - Include file not found

Import Resolution Errors (TS9701-TS9799)

Operator Errors (TS9801-TS9899)

  • TS9800 - Operator not defined
  • TS9801 - Invalid operator method
  • TS9802 - Ambiguous operator
  • TS9803 - Unknown custom operator (warning)

Internal Errors (TS9901-TS9999)

Reporting Issues

If you encounter an error that isn't documented here, or if the suggested fixes don't resolve your issue, please open an issue with:

  1. The full error message
  2. A minimal reproduction
  3. Your typesugar version (npx typesugar --version)

Released under the MIT License.