Skip to content

E1xxx: Type-checking errors ​

This page is generated by scripts/docs/gen-error-code-docs.py from the define_codes! registry in src/util/diagnostic/codes/ and locales/en.json. Do not edit it by hand. Change the wording in locales/*.json, change the code table in define_codes!, then rerun python scripts/docs/gen-error-code-docs.py.

Errors produced during type checking, covering type matching, pattern matching, generic instantiation, interface constraints, and ? error propagation.

This family holds 62 codes, all registered in the define_codes! registry, with the category TypeCheck. See the error code index for the complete inventory.

Code Overview ​

CodeNameCategoryspan exemptTemplateEmission sites
E1001Unknown variableTypeCheckNoUnknown variable: '{name}'✅ 6 sites
E1002Type mismatchTypeCheckNoExpected type '{expected}', found type '{found}'✅ 77 sites
E1003Unknown typeTypeCheckNoUnknown type: '{type}'✅ 3 sites
E1010Argument count mismatchTypeCheckNofunction '{func}' expected {expected} arguments, found {found}✅ 19 sites
E1011Implementation parameter annotation mismatchTypeCheckNoimplementation parameter annotation mismatch: expected '{expected}', found '{found}'✅ 1 site
E1012Return type mismatchTypeCheckNoreturn type mismatch: expected '{expected}', found '{found}'✅ 4 sites
E1013Function not foundTypeCheckNoFunction not found: '{func}'✅ 3 sites
E1014Unknown named argumentTypeCheckNoFunction '{func}' has no parameter named '{name}' (available: {params})✅ 2 sites
E1015Argument specified more than onceTypeCheckNoParameter '{name}' of function '{func}' was specified more than once✅ 1 site
E1020Cannot infer typeTypeCheckNoCannot infer the type of '{expr}'⚠ Not yet emitted
E1021Type inference conflictTypeCheckNotype inference conflict: {reason}⚠ Not yet emitted
E1030Non-exhaustive patternsTypeCheckNonon-exhaustive patterns: missing {patterns}✅ 2 sites
E1031Unreachable patternTypeCheckNounreachable pattern: '{pattern}'✅ 5 sites
E1032Duplicate binding in patternTypeCheckNoDuplicate pattern binding: '{name}' appears multiple times in the same pattern✅ 2 sites
E1033Inconsistent bindings in or-patternTypeCheckNoInconsistent bindings in or-pattern: both sides of \|` must bind the same set of names`✅ 1 site
E1034Missing field in struct patternTypeCheckNoStruct pattern missing field '{field}' (all fields of '{struct}' must be fully covered)✅ 1 site
E1040Operation not supportedTypeCheckNotype '{type}' does not support operation '{op}'⚠ Not yet emitted
E1041Index out of boundsTypeCheckNoindex out of bounds: valid range is 0..{max}, found {index}✅ 5 sites
E1042Field not foundTypeCheckNofield '{field}' not found in struct '{struct}'✅ 10 sites
E1043Module member not foundTypeCheckNoModule '{module}' did not export '{name}'✅ 1 site
E1050Boolean operand requiredTypeCheckNoLogical operation requires boolean operands, got '{left}' and '{right}'✅ 1 site
E1051Logical NOT requires boolean operandTypeCheckNoLogical NOT requires boolean operand, got '{type}'✅ 1 site
E1052Invalid dereferenceTypeCheckNoCannot dereference type '{type}', expected pointer type✅ 1 site
E1053Non-struct field accessTypeCheckNoCannot access field on non-struct type '{type}'✅ 2 sites
E1054Condition type mismatchTypeCheckNoCondition must be a boolean type, got '{type}'✅ 4 sites
E1055Constraint in non-generic contextTypeCheckNoConstraint type '{type}' can only be used in a generic context⚠ Not yet emitted
E1060Type parameter count mismatchTypeCheckNoexpected {expected} type parameters, found {found}⚠ Not yet emitted
E1061Cannot instantiate genericTypeCheckNocannot instantiate generic type with given parameters⚠ Not yet emitted
E1062Const generic constraint failedTypeCheckNoconst generic constraint failed: \` does not hold`✅ 1 site
E1064Invalid binding position indexTypeCheckNoInvalid binding position index: {positions} (the function has {total} parameters)✅ 3 sites
E1065Call of non-function valueTypeCheckNotype \` is not callable — it is not a function`✅ 1 site
E1071Type definitions only allowed at module levelTypeCheckNotype definition '{name}' is only allowed at module level (module top level)✅ 2 sites
E1081? is only allowed in functions returning a propagatable typeTypeCheckNo\?` is only allowed in functions returning a type that implements `Try``✅ 2 sites
E1082? can only be used on types that implement TryTypeCheckNo'{type}' does not implement the \Try` interface, so `?` cannot be used`✅ 1 site
E1083Error type mismatch for ?TypeCheckNoError type mismatch for \?`: expected '{expected}', found '{found}'`✅ 1 site
E1090✨ Unspeakable ✨TypeCheckNoType: Type = Type⚠ Not yet emitted
E1091Invalid generic meta typeTypeCheckNoGeneric meta type self-reference is not allowed: '{decl}'✅ 1 site
E1092Invalid refinement type argument formTypeCheckNo'{name}' requires a compile-time constant argument, but the given argument cannot be converted✅ 10 sites
E1093Refinement argument count mismatchTypeCheckNo'{name}' expected {expected} argument(s), found {found}✅ 2 sites
E1094Unused compile-time value parameterTypeCheckNo'{param}' is declared as a compile-time value parameter of '{type}', but is not referenced in the type body✅ 1 site
E1095Unknown interfaceTypeCheckNoUnknown interface: '{name}' (the name referenced by the type body is not a registered type constructor)✅ 1 site
E1096Interface parameter count mismatchTypeCheckNoInterface '{name}' expected {expected} type parameters, found {found}✅ 3 sites
E1097Interface member naming conflictTypeCheckNoMember '{member}' of type '{type}' conflicts with an interface member (fields and methods share a namespace, §1.2)✅ 1 site
E1098Interface method not implementedTypeCheckNotype '{type}' does not implement method '{method}' of interface '{interface}'✅ 1 site
E1099Interface method signature mismatchTypeCheckNomethod '{method}' of type '{type}' does not match the interface signature: expected {expected}, found {found}✅ 2 sites
E1100Duplicate interface method implementationTypeCheckNomethod '{method}' of type '{type}' is implemented more than once (same-signature override is forbidden, §3)✅ 1 site
E1101Type does not implement interfaceTypeCheckNotype '{type}' does not implement interface '{interface}' and cannot enter this existential type position✅ 5 sites
E1102Loop control statement appears outside a loopTypeCheckNo'{keyword}' appears outside a loop✅ 2 sites
E1103Square brackets cannot be used in type positionTypeCheckYes'{name}[...]' is not type syntax—type arguments require parentheses✅ 1 site
E1104Interface implementation is not in the type's defining moduleTypeCheckNoType '{type}' is not defined by this module; interface '{interface}' cannot be implemented for it in this module✅ 1 site
E1105Variant constructor cannot be used as field accessTypeCheckNo'{variant}' is a variant constructor of the sum type '{type}', not a data field✅ 1 site
E1106Constrained method dispatch failedTypeCheckNoConstrained method dispatch failed: \`—{detail}`✅ 1 site
E1107Method overload ambiguityTypeCheckNoMethod overload ambiguity: '{key}' has {count} candidate matches that cannot be distinguished✅ 1 site
E1108Empty block in container expected positionTypeCheckYesA container type is expected here, but \{}` is an empty block (value Void)`✅ 2 sites
E1109Return appears outside a functionTypeCheckNo'return' appears outside a function✅ 3 sites
E1110Method binding missing signature annotationTypeCheckNo'{type}.{method}' is missing a signature annotation✅ 1 site
E1111Argument duplicate or invalid orderTypeCheckNofunction '{func}' parameter '{name}' received multiple arguments (or argument order is invalid)✅ 2 sites
E1112Implementation declares more parameters than the signatureTypeCheckNoThe annotation for function '{name}' provides only {expected} runtime parameter slots, but the implementation header specifies {found} parameters; the extra one has no value to bind to.✅ 1 site
E1113Compile-time value parameter lacks compile-time evidenceTypeCheckNoCompile-time value parameter '{param}' requires compile-time evidence, but the argument cannot be determined at compile time✅ 1 site
E1114Witness field is not readable at value levelTypeCheckNoWitness field '{field}' is compile-time evidence of record '{type}' and has no runtime data slot; it cannot be read at value level✅ 3 sites
E1115Witness-bearing record is immutableTypeCheckNoRecord '{type}' carries a witness field, so all of its fields must stay unchanged after construction✅ 4 sites
E1116Bare name collides with exports of multiple standard library unitsTypeCheckNo'{name}' is exported by multiple standard library units ({units}); a bare name cannot determine the call target✅ 1 site

Code Details ​

E1001: Unknown variable ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unknown_variable(name)
  • Template: Unknown variable: '{name}'
  • Message: The referenced variable is undefined
  • Help: Check if the variable name is spelled correctly, or define it first
  • Emission sites: src/frontend/core/sema/record_model.rs:377, src/frontend/core/sema/record_model.rs:382, src/frontend/core/sema/checker/refinement.rs:479 and 6 more sites
  • Source comment name: 未知变量

E1002: Type mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::type_mismatch(expected, found)
  • Template: Expected type '{expected}', found type '{found}'
  • Message: The expected type does not match the actual type
  • Help: Use the correct type or add a type conversion
  • Emission sites: src/frontend/core/sema/checker.rs:160, src/frontend/core/sema/inference/bounds.rs:302, src/frontend/core/sema/inference/bounds.rs:310 and 77 more sites
  • Source comment name: 类型不匹配

E1003: Unknown type ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unknown_type(type_)
  • Template: Unknown type: '{type}'
  • Message: The referenced type does not exist
  • Help: Check if the type name is spelled correctly
  • Emission sites: src/frontend/core/sema/checker/annotations.rs:370, src/frontend/core/sema/environment.rs:944, src/util/test_markers.rs:241
  • Source comment name: 未知类型

E1010: Argument count mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::argument_count_mismatch(func, expected, found)
  • Template: function '{func}' expected {expected} arguments, found {found}
  • Message: function call arguments do not match the definition
  • Help: check the argument count of the function call
  • Emission sites: src/frontend/core/sema/environment.rs:854, src/frontend/core/sema/inference/arg_binding.rs:125, src/frontend/core/sema/inference/expressions/match.rs:444 and 19 more sites
  • Source comment name: 参数数量不匹配

E1011: Implementation parameter annotation mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::parameter_type_mismatch(expected, found)
  • Template: implementation parameter annotation mismatch: expected '{expected}', found '{found}'
  • Message: an implementation parameter's annotation does not match the declaration
  • Help: the declaration is authoritative: drop the annotation from the implementation head (its parameters are positional binders), or make it match the declaration
  • Emission sites: src/frontend/core/sema/inference/statements/fn_def.rs:284
  • Source comment name: 参数类型不匹配

E1012: Return type mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::return_type_mismatch(expected, found)
  • Template: return type mismatch: expected '{expected}', found '{found}'
  • Message: function return type is incorrect
  • Help: the function body's value does not match the declared return type. Either modify the function body, or fix the annotation—note that h: () -> Int = f means "h returns Int", not "h is f"; to give the function an alias, write h = f.
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:737, src/frontend/core/sema/inference/expressions/dispatch.rs:757, src/frontend/core/sema/inference/statements/fn_def.rs:606 and 4 more sites
  • Source comment name: 返回类型不匹配

E1013: Function not found ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::function_not_found(func)
  • Template: Function not found: '{func}'
  • Message: Undefined function called
  • Help: Check that the function name is spelled correctly
  • Emission sites: src/backends/mod.rs:140, src/backends/interpreter/executor/debug.rs:145, src/backends/interpreter/executor/executor.rs:326
  • Source comment name: 函数未找到

E1014: Unknown named argument ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unknown_argument(func, name, params)
  • Template: Function '{func}' has no parameter named '{name}' (available: {params})
  • Message: Argument name used in call is not in the function's parameter list
  • Help: Use a name listed in the parameter list, or pass arguments by position instead
  • Emission sites: src/frontend/core/sema/inference/arg_binding.rs:79, src/frontend/core/sema/inference/expressions/call/mod.rs:1004
  • Source comment name: 命名参数名未知(与调用者写的名字不在形参表里)

E1015: Argument specified more than once ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::duplicate_argument(func, name)
  • Template: Parameter '{name}' of function '{func}' was specified more than once
  • Message: The same parameter was specified by both a positional and a named argument
  • Help: Each argument can only be passed once: remove the extra named or positional argument
  • Emission sites: src/frontend/core/sema/inference/arg_binding.rs:95
  • Source comment name: 同一形参被命名实参重复指定(位置+命名争同一槽位、命名后接位置走 E1111)

E1020: Cannot infer type ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::cannot_infer_type(expr)
  • Template: Cannot infer the type of '{expr}'
  • Message: Type cannot be inferred from context
  • Help: add type annotations or explicit type arguments
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 无法推断类型

E1021: Type inference conflict ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::type_inference_conflict(reason)
  • Template: type inference conflict: {reason}
  • Message: multiple constraints result in type contradiction
  • Help: check consistency of type annotations
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 类型推断冲突

E1030: Non-exhaustive patterns ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::pattern_non_exhaustive(patterns)
  • Template: non-exhaustive patterns: missing {patterns}
  • Message: match expression does not cover all cases
  • Help: add missing patterns to the match expression
  • Emission sites: src/frontend/core/sema/inference/expressions/match.rs:278, src/frontend/core/sema/inference/expressions/match.rs:289
  • Source comment name: 模式穷举不足

E1031: Unreachable pattern ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unreachable_pattern(pattern)
  • Template: unreachable pattern: '{pattern}'
  • Message: pattern that can never be matched
  • Help: remove or modify the unreachable pattern
  • Emission sites: src/frontend/core/sema/inference/expressions/match.rs:118, src/frontend/core/sema/inference/expressions/match.rs:135, src/frontend/core/sema/inference/expressions/match.rs:143 and 5 more sites
  • Source comment name: 不可达模式

E1032: Duplicate binding in pattern ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::duplicate_pattern_binding(name)
  • Template: Duplicate pattern binding: '{name}' appears multiple times in the same pattern
  • Message: '{name}' is bound multiple times in the same pattern
  • Help: Each name can only be bound once within a pattern; to match two identical fields, use different names (same as Rust semantics)
  • Emission sites: src/frontend/core/sema/inference/expressions/match.rs:344, src/frontend/core/sema/inference/expressions/match.rs:492
  • Source comment name: 模式重复绑定(RFC-010b:同一模式内同名绑定出现多次)

E1033: Inconsistent bindings in or-pattern ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::or_pattern_binding_mismatch()
  • Template: Inconsistent bindings in or-pattern: both sides of \|` must bind the same set of names`
  • Message: The name sets bound by each alternative of \| differ
  • Help: Each alternative of an or-pattern a(x) \| b(x) must introduce exactly the same binding names (same as Rust semantics)
  • Emission sites: src/frontend/core/sema/inference/expressions/match.rs:320
  • Source comment name: 或模式绑定不一致(RFC-010b:各备选绑定的名字集不同)

E1034: Missing field in struct pattern ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::struct_pattern_missing_field(struct_, field)
  • Template: Struct pattern missing field '{field}' (all fields of '{struct}' must be fully covered)
  • Message: Struct pattern does not cover field '{field}'
  • Help: Struct patterns must list all fields; the .. shorthand is not yet supported
  • Emission sites: src/frontend/core/sema/inference/expressions/match.rs:486
  • Source comment name: 结构体模式缺字段(RFC-010b:字段须完整覆盖,.. 略名未支持)

E1040: Operation not supported ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unsupported_operation(op, type_)
  • Template: type '{type}' does not support operation '{op}'
  • Message: type does not support this operation
  • Help: check the operations supported by this type
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 不支持的操作

E1041: Index out of bounds ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::index_out_of_bounds(max, index)
  • Template: index out of bounds: valid range is 0..{max}, found {index}
  • Message: array/list index out of range
  • Help: ensure the index is within the collection bounds
  • Emission sites: src/backends/mod.rs:188, src/backends/interpreter/executor/ops/elem.rs:225, src/backends/interpreter/executor/ops/elem.rs:304 and 5 more sites
  • Source comment name: 数组越界

E1042: Field not found ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::field_not_found(field, struct_)
  • Template: field '{field}' not found in struct '{struct}'
  • Message: accessed a non-existent struct field
  • Help: Check the fields available on the struct; for an evidence field path in a predicate body, verify the evidence field name in the record definition.
  • Emission sites: src/backends/mod.rs:158, src/frontend/core/sema/checker.rs:3634, src/frontend/core/sema/inference/expressions/dispatch.rs:409 and 10 more sites
  • Source comment name: 字段未找到

E1043: Module member not found ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::module_has_no_export(module, name, available)
  • Template: Module '{module}' did not export '{name}'
  • Message: Accessed a member that the module did not export
  • Help: Available exports of this module:
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:542
  • Source comment name: 模块成员未找到(#396:模块别名上取成员失败。模块不是 struct,

E1050: Boolean operand required ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::logical_operand_type_mismatch(left, right)
  • Template: Logical operation requires boolean operands, got '{left}' and '{right}'
  • Message: Logical operation requires boolean operands
  • Help: Convert the operands to boolean type or use other operators
  • Emission sites: src/frontend/core/sema/inference/expressions/operators.rs:167
  • Source comment name: 逻辑运算需要布尔操作数

E1051: Logical NOT requires boolean operand ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::logical_not_type_mismatch(type_)
  • Template: Logical NOT requires boolean operand, got '{type}'
  • Message: Logical NOT operation requires boolean operand
  • Help: Convert the operand to boolean type before applying NOT
  • Emission sites: src/frontend/core/sema/inference/expressions/operators.rs:592
  • Source comment name: 逻辑 NOT 需要布尔操作数

E1052: Invalid dereference ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::invalid_deref(type_)
  • Template: Cannot dereference type '{type}', expected pointer type
  • Message: Cannot dereference non-pointer type
  • Help: Only pointer types can be dereferenced
  • Emission sites: src/frontend/core/sema/inference/expressions/operators.rs:605
  • Source comment name: 不能解引用非指针类型

E1053: Non-struct field access ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::field_access_on_non_struct(type_)
  • Template: Cannot access field on non-struct type '{type}'
  • Message: Cannot access field on non-struct type
  • Help: Field access is only available on struct types
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:605, src/frontend/core/sema/inference/expressions/dispatch.rs:609
  • Source comment name: 不能在非结构体类型上访问字段

E1054: Condition type mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::condition_type_mismatch(type_)
  • Template: Condition must be a boolean type, got '{type}'
  • Message: Condition expression must be a boolean type
  • Help: Use a boolean expression or convert to a boolean type
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:661, src/frontend/core/sema/inference/expressions/dispatch.rs:939, src/frontend/core/sema/inference/expressions/stmt_walk.rs:204 and 4 more sites
  • Source comment name: 条件必须是布尔类型

E1055: Constraint in non-generic context ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::constraint_not_in_generic(type_)
  • Template: Constraint type '{type}' can only be used in a generic context
  • Message: Constraint type used in a non-generic context
  • Help: Use a concrete type instead of a constraint type
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 约束类型只能在泛型上下文中使用

E1060: Type parameter count mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::type_argument_count_mismatch(expected, found)
  • Template: expected {expected} type parameters, found {found}
  • Message: wrong number of type parameters provided
  • Help: provide the correct number of type parameters
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 类型参数数量不匹配

E1061: Cannot instantiate generic ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::cannot_instantiate_generic()
  • Template: cannot instantiate generic type with given parameters
  • Message: generic type cannot be instantiated with given parameters
  • Help: ensure type parameters satisfy all constraints
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 无法实例化泛型类型

E1062: Const generic constraint failed ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::const_constraint_failed(constraint)
  • Template: const generic constraint failed: \` does not hold`
  • Message: value constraint of const generic parameter is not satisfied
  • Help: modify const parameter value to satisfy the constraint
  • Emission sites: src/frontend/core/sema/environment.rs:914
  • Source comment name: const 泛型约束失败

E1064: Invalid binding position index ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::invalid_binding_position(positions, total)
  • Template: Invalid binding position index: {positions} (the function has {total} parameters)
  • Help: The binding position must fall within the parameter range of the bound function (out of range, or still negative after normalization). Check the position numbers of the method binding.
  • Emission sites: src/frontend/core/sema/checker.rs:2420, src/frontend/core/sema/checker.rs:2524, src/frontend/core/sema/checker.rs:2537
  • Source comment name: 绑定位置索引无效(RFC-004)

E1065: Call of non-function value ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::not_callable(type_)
  • Template: type \` is not callable — it is not a function`
  • Help: only function values can be called. Please check the type of the expression at this position; to define a function, write an Fn annotation f: () -> T = { ... }.
  • Emission sites: src/frontend/core/sema/inference/expressions/call/mod.rs:235
  • Source comment name: 对非函数值调用

E1071: Type definitions only allowed at module level ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::type_def_only_at_module_level(name)
  • Template: type definition '{name}' is only allowed at module level (module top level)
  • Message: type definitions can only appear at the module top level
  • Help: move the type definition to the module top level
  • Emission sites: src/frontend/core/sema/inference/expressions/stmt_walk.rs:472, src/frontend/core/sema/inference/statements/stmt.rs:399
  • Source comment name: 类型定义只能在模块级

E1081: ? is only allowed in functions returning a propagatable type ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::try_only_allowed_in_result()
  • Template: \?` is only allowed in functions returning a type that implements `Try``
  • Message: ? can only be used in functions returning a type that implements Try
  • Help: The failure value of ? propagates along the function's return type — the return type must implement the Try interface (e.g., Result(T, E))
  • Emission sites: src/frontend/core/sema/inference/expressions/stmt_walk.rs:51, src/frontend/core/sema/inference/expressions/stmt_walk.rs:82
  • Source comment name: ``? 仅允许在返回 Result 的函数内使用

E1082: ? can only be used on types that implement Try ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::try_requires_result(type_)
  • Template: '{type}' does not implement the \Try` interface, so `?` cannot be used`
  • Message: ? can only be used on expressions of a type that implements the Try interface
  • Help: Implement the four members of the Try interface (is_failure/success/residual/from_error) for this type, or use Result(T, E) instead
  • Emission sites: src/frontend/core/sema/inference/expressions/stmt_walk.rs:42
  • Source comment name: ``? 只能用于 Result 表达式

E1083: Error type mismatch for ? ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::try_error_type_mismatch(expected, found)
  • Template: Error type mismatch for \?`: expected '{expected}', found '{found}'`
  • Message: The error type of expr? does not match the outer function's return type
  • Help: Ensure that the error type E of the current function's return type Result[_, E] matches the error type of the Result[_, E] being unpacked.
  • Emission sites: src/frontend/core/sema/inference/expressions/stmt_walk.rs:75
  • Source comment name: ``? 的错误类型不匹配

E1090: ✨ Unspeakable ✨ ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::type_self_reference_easter_egg()
  • Template: Type: Type = Type
  • Message: You have reached the philosophical boundary of YaoXiang
  • Help: This is the source of the language; the compiler falls silent here
  • Emission site: ⚠ Not yet emitted (the registry retains the code, but non-test code never calls it, so users cannot trigger it)
  • Source comment name: 彩蛋(返回占位符,由 i18n 的 zen_message 提供实际消息)

E1091: Invalid generic meta type ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::invalid_generic_self_reference(decl)
  • Template: Generic meta type self-reference is not allowed: '{decl}'
  • Message: Generic meta type self-reference is not allowed
  • Help: Type constructors like 'Type[T]' cannot reference Type itself
  • Emission sites: src/frontend/core/sema/checker.rs:2866
  • Source comment name: 泛型元类型自指错误

E1092: Invalid refinement type argument form ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::refined_arg_not_const(name)
  • Template: '{name}' requires a compile-time constant argument, but the given argument cannot be converted
  • Message: refinement type argument cannot be converted to a compile-time constant expression
  • Help: Predicate/proof function arguments must be literals, variables, or single-parameter type applications; otherwise, a refinement constraint cannot be generated. In a type position or predicate body, an evidence field path must consist solely of the evidence field of the predicate's sole formal parameter, and its base name must match the name of the applied argument.
  • Emission sites: src/frontend/core/sema/checker.rs:3575, src/frontend/core/sema/checker.rs:3579, src/frontend/core/sema/checker.rs:3616 and 10 more sites
  • Source comment name: 精化类型实参形态非法(RFC-027,#263)

E1093: Refinement argument count mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::refined_arity_mismatch(name, expected, found)
  • Template: '{name}' expected {expected} argument(s), found {found}
  • Message: predicate/proof function argument count mismatch
  • Help: the number of arguments must match the predicate declaration, otherwise the refinement constraint cannot be generated
  • Emission sites: src/frontend/core/sema/checker.rs:3572, src/frontend/core/sema/checker/predicates.rs:196
  • Source comment name: 精化类型参数数量不匹配

E1094: Unused compile-time value parameter ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unused_const_param(param, type_)
  • Template: '{param}' is declared as a compile-time value parameter of '{type}', but is not referenced in the type body
  • Message: The compile-time value parameter is not referenced in the type body
  • Help: Reference this parameter in type positions (field types, inner Fn parameter types, Assert/Array type arguments), or remove it from the declaration
  • Emission sites: src/frontend/core/sema/checker.rs:3138
  • Source comment name: 编译期值参数未在类型体引用(#297/F)

E1095: Unknown interface ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::unknown_interface(name)
  • Template: Unknown interface: '{name}' (the name referenced by the type body is not a registered type constructor)
  • Message: Unknown interface
  • Help: Check the name spelling, or first declare the interface with Iface: (Self: Type) -> Type = {{ ... }}
  • Emission sites: src/frontend/core/sema/checker/interface.rs:171
  • Source comment name: 未知接口(RFC-011a)

E1096: Interface parameter count mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::interface_arity_mismatch(name, expected, found)
  • Template: Interface '{name}' expected {expected} type parameters, found {found}
  • Message: Interface parameter count mismatch
  • Help: Provide arguments according to the number of type parameters declared by the interface
  • Emission sites: src/frontend/core/sema/checker/interface.rs:133, src/frontend/core/sema/checker/interface.rs:149, src/frontend/core/sema/checker/interface.rs:179
  • Source comment name: 接口实例化类型实参个数不匹配(RFC-011a)

E1097: Interface member naming conflict ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::interface_member_conflict(type_, member)
  • Template: Member '{member}' of type '{type}' conflicts with an interface member (fields and methods share a namespace, §1.2)
  • Message: Interface member naming conflict
  • Help: Rename the field or the interface member
  • Emission sites: src/frontend/core/sema/checker/interface.rs:316
  • Source comment name: 接口成员与类型已有字段共享命名空间(RFC-011a §1.2)

E1098: Interface method not implemented ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::interface_method_missing(type_, interface, method)
  • Template: type '{type}' does not implement method '{method}' of interface '{interface}'
  • Message: interface method not implemented
  • Help: declare the method as Type.method: signature = ..., or provide the binding within the type body
  • Emission sites: src/frontend/core/sema/checker/interface.rs:337
  • Source comment name: 接口方法未实现(RFC-011a 完整性检查)

E1099: Interface method signature mismatch ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::interface_method_mismatch(type_, method, expected, found)
  • Template: method '{method}' of type '{type}' does not match the interface signature: expected {expected}, found {found}
  • Message: interface method signature mismatch
  • Help: make the implementation signature exactly match the interface member signature (§3 forbids override, allows overloading)
  • Emission sites: src/frontend/core/sema/checker/interface.rs:203, src/frontend/core/sema/checker/interface.rs:368
  • Source comment name: 接口方法签名不匹配(RFC-011a)

E1100: Duplicate interface method implementation ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::interface_method_duplicate(type_, method)
  • Template: method '{method}' of type '{type}' is implemented more than once (same-signature override is forbidden, §3)
  • Message: duplicate interface method implementation
  • Help: remove the duplicate implementation and keep one
  • Emission sites: src/frontend/core/sema/checker.rs:2194
  • Source comment name: 同签名接口方法重复实现(RFC-011a §3 覆盖禁止)

E1101: Type does not implement interface ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::type_does_not_implement_interface(type_, interface)
  • Template: type '{type}' does not implement interface '{interface}' and cannot enter this existential type position
  • Message: type does not implement interface
  • Help: implement all members of the interface and instantiate within the type body (e.g., Animal(Dog)); for RFC-011b scenarios (equality/operators), implement the corresponding interface for the type; linear token fields must be removed first
  • Emission sites: src/frontend/core/sema/inference/existential.rs:150, src/frontend/core/sema/inference/expressions/operators.rs:438, src/frontend/core/sema/inference/expressions/operators.rs:462 and 5 more sites
  • Source comment name: 具体类型未实现目标接口(RFC-011a §6.3 存在类型成员检查)

E1102: Loop control statement appears outside a loop ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::break_outside_loop(keyword)
  • Template: '{keyword}' appears outside a loop
  • Message: break/continue can only be used within while/for loop bodies
  • Help: move '{keyword}' into a while/for loop body
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:776, src/frontend/core/sema/inference/expressions/dispatch.rs:786
  • Source comment name: break/continue 出现在循环外(#311:仅 while/for 体内允许循环控制流)

E1103: Square brackets cannot be used in type position ​

  • Category: TypeCheck
  • span exempt: Yes
  • Constructor: ErrorCodeDefinition::bracket_in_type_position(name)
  • Template: '{name}[...]' is not type syntax—type arguments require parentheses
  • Message: Type arguments use parentheses; square brackets are value-level subscripts
  • Help: Write it as {name}(...). Square brackets are value-level subscripts (list[0]); in type position only parentheses are allowed: List(Int) rather than List[Int].
  • Emission sites: src/frontend/core/sema/checker/annotations.rs:368
  • Source comment name: 类型位置的方括号写法(#371)。

E1104: Interface implementation is not in the type's defining module ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::interface_impl_outside_defining_module(type_, interface)
  • Template: Type '{type}' is not defined by this module; interface '{interface}' cannot be implemented for it in this module
  • Message: Operator interface implementations must be written in the type's defining module
  • Help: Orphan rule: implementations follow the type's defining module. You can only write interface instantiations for types defined in this module (e.g., Add(Point, Point, Point)); operator interfaces for builtin types (Int/List, etc.) are provided by the core and cannot be supplemented
  • Emission sites: src/frontend/core/sema/checker/interface.rs:288
  • Source comment name: 接口实现写在了非定义模块(RFC-011b 孤儿规则:实现跟随类型的

E1105: Variant constructor cannot be used as field access ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::variant_used_as_field(type_, variant)
  • Template: '{variant}' is a variant constructor of the sum type '{type}', not a data field
  • Message: Variant constructors can only be used in the call form Type.Variant(...)
  • Help: To construct a value, write {type}.{variant}(...); to extract payloads from a sum type value, use match variant destructuring (RFC-010b). All record fields of sum types are elevated to variants; runtime values do not carry a field table
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:395
  • Source comment name: 变体构造器被当作字段访问(RFC-010 记录式和类型:变体名升格,

E1106: Constrained method dispatch failed ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::constraint_dispatch_failed(dispatch, detail)
  • Template: Constrained method dispatch failed: \`—{detail}`
  • Help: Implement the corresponding interface for this type (write an interface instantiation and define methods inside the type body), or use arguments that already implement this interface
  • Emission sites: src/middle/passes/mono/mod.rs:1473
  • Source comment name: 约束方法派发失败(发射面:mono 特化改写——src/middle/passes/mono/mod.rs

E1107: Method overload ambiguity ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::ambiguous_method_overload(key, count)
  • Template: Method overload ambiguity: '{key}' has {count} candidate matches that cannot be distinguished
  • Message: '{key}' has {count} candidate matches, cannot be resolved
  • Help: Add a type annotation to the call result (e.g. x: T = obj.m()), or make the parameter types of overload candidates distinguishable
  • Emission sites: src/frontend/core/sema/inference/expressions/call/mod.rs:941
  • Source comment name: 方法重载歧义(RFC-011a §3:多候选且无期望类型可区分)

E1108: Empty block in container expected position ​

  • Category: TypeCheck
  • span exempt: Yes
  • Constructor: ErrorCodeDefinition::empty_block_as_container()
  • Template: A container type is expected here, but \{}` is an empty block (value Void)`
  • Message: {} is an empty block (value Void), not a container literal
  • Help: Plan B semantics (SPEC syntax §1.6.4): {} is an empty block, not an empty dictionary. Use dict.new() for an empty dictionary, and [] for an empty list
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:811, src/frontend/core/sema/inference/expressions/call/mod.rs:545
  • Source comment name: 空块 {}落入容器期望位(#394:B 方案定案的{} = 空块 Void,

E1109: Return appears outside a function ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::return_outside_function()
  • Template: 'return' appears outside a function
  • Message: 'return' can only be used inside a function body; the Script top level is the module initialization layer, with no function boundary to return from
  • Help: Move 'return' into a function body. In Script mode, top-level statements are the program body; to terminate a top-level logic block early, wrap it in a function and control it at the call site
  • Emission sites: src/frontend/core/sema/inference/expressions/dispatch.rs:696, src/frontend/core/sema/inference/statements/stmt.rs:341, src/frontend/core/sema/inference/statements/stmt.rs:356
  • Source comment name: return 出现在函数外(RFC-010a 规则②边界条件:return 退出最近的

E1110: Method binding missing signature annotation ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::method_binding_without_signature(type_, method)
  • Template: '{type}.{method}' is missing a signature annotation
  • Message: Method binding '{type}.{method}' has no signature annotation, the compiler cannot determine its receiver, parameter names and return type
  • Help: Add a signature annotation: '{type}.{method}: (self: &{type}, ...) -> return type = function body'; to reuse an existing function, write '{type}.{method}: (…) -> return type = function_name[position]'
  • Emission sites: src/middle/lower/stmt.rs:291
  • Source comment name: 方法绑定缺少签名标注(issue #451,语义修正分流 A 类:旧行为是

E1111: Argument duplicate or invalid order ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::argument_order_invalid(func, name)
  • Template: function '{func}' parameter '{name}' received multiple arguments (or argument order is invalid)
  • Message: A single parameter received multiple arguments, or a positional argument was written after a named argument
  • Help: Each parameter can only be filled by one argument: positional arguments occupy leading slots, named arguments are placed by name and must be written after positional arguments; please remove the extra one, or move the positional argument to the front
  • Emission sites: src/frontend/core/sema/inference/arg_binding.rs:62, src/frontend/core/sema/inference/arg_binding.rs:102
  • Source comment name: 一个形参收到多个实参 / 实参顺序非法(#452 复审 F2:争槽位与

E1112: Implementation declares more parameters than the signature ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::implementation_param_count_mismatch(name, expected, found)
  • Template: The annotation for function '{name}' provides only {expected} runtime parameter slots, but the implementation header specifies {found} parameters; the extra one has no value to bind to.
  • Message: The function body specifies more parameters than the annotation provides runtime parameter slots for; the extra parameters have no values to bind to.
  • Help: The number of runtime values a function can accept is determined by its annotation: remove the extra parameters from the implementation header, or add their slots to the annotation (f: (a: Int, b: Int) -> Int = (a, b) => ...). Parameters used only in type positions are compile-time value parameters and do not occupy runtime slots.
  • Emission sites: src/frontend/core/sema/inference/statements/fn_def.rs:897
  • Source comment name: 实现形参个数超出声明(声明驱动的 Fn 标注 ↔ 函数体

E1113: Compile-time value parameter lacks compile-time evidence ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::missing_compile_time_evidence(param)
  • Template: Compile-time value parameter '{param}' requires compile-time evidence, but the argument cannot be determined at compile time
  • Help: Pass a literal or a compile-time constant, or make that parameter an ordinary runtime value parameter
  • Emission sites: src/frontend/core/sema/inference/expressions/call/instantiation.rs:921
  • Source comment name: 编译期值参数缺少编译期证据(量词读数 / issue #533,6.9.2-B;

E1114: Witness field is not readable at value level ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::witness_field_not_readable(type_, field)
  • Template: Witness field '{field}' is compile-time evidence of record '{type}' and has no runtime data slot; it cannot be read at value level
  • Help: The witness field is used at the type level: b.w is an evidence item that can serve as a premise in a proof; it is not a value-level read (there is no data slot at runtime). When runtime data is needed, define the field as a regular data field.
  • Emission sites: src/frontend/core/sema/record_model.rs:380, src/frontend/core/sema/inference/expressions/dispatch.rs:510, src/frontend/core/sema/inference/expressions/dispatch.rs:569
  • Source comment name: witness 字段不可值级读取(6.9.5-B.1b / B.2;量词读数 / issue #536 的 B 路线,

E1115: Witness-bearing record is immutable ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::witness_record_immutable(type_)
  • Template: Record '{type}' carries a witness field, so all of its fields must stay unchanged after construction
  • Help: A witness-bearing record cannot declare mut fields, assign fields, take &mut borrows, or call methods that require a write borrow; move mutable data into a record without witnesses.
  • Emission sites: src/frontend/core/sema/checker.rs:2891, src/frontend/core/sema/inference/expressions/dispatch.rs:994, src/frontend/core/sema/inference/expressions/call/mod.rs:722 and 4 more sites
  • Source comment name: witness-bearing 记录不可变(6.9.5-B.1c / 5A 整体不可变;量词读数 /

E1116: Bare name collides with exports of multiple standard library units ​

  • Category: TypeCheck
  • span exempt: No
  • Constructor: ErrorCodeDefinition::ambiguous_std_export(name, units)
  • Template: '{name}' is exported by multiple standard library units ({units}); a bare name cannot determine the call target
  • Help: The same short name is exported by multiple standard library crates, with no default target (previously, compiling the same source code multiple times would randomly select a target). To disambiguate explicitly, choose one of the listed crates and import the item using the use item import form, then continue using the bare name; or write the call with a qualified name (crate name, dot, followed by the item name). The candidate crates are those listed in this error.
  • Emission sites: src/frontend/core/sema/inference/statements/refine.rs:72
  • Source comment name: 裸名与多个标准库单元的导出同名(issue #577,用户裁决乙案;与 #477