Skip to content

Commit 6c59d51

Browse files
JonoPrestclaude
andcommitted
Restore changed catalog rows to their master table positions
The 9 re-audited variants (Type_clash, Parameters_differ, Null_arity_external, Bad_fixed_type, Varying_anonymous, Invalid_interval, Incoherent_label_order, Illegal_value_name, Unbound_type_constructor_2) had their per-module table rows deleted and the info relocated to the prose list, causing line drift. Each row is now back in its master position with an in-place status update (⚠ -> ✓ + fixture; Type_clash stays ⚠ "appears dead, retained"), so the diff reads as a row-level edit instead of a move. Verified all four module tables (typecore/typedecl/env/typetexp) now match master row order; remaining gaps are only the genuinely-removed variants. Signed-Off-By: Jono Prest <jono@envio.dev> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3bcd4ff commit 6c59d51

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

tests/ERROR_VARIANTS.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,14 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml).
197197
|---|---|---|---|
198198
| `Polymorphic_label` || `polymorphic_label.res` | Pattern that instantiates a polymorphic record field: `({f: (f: int => int)}: t) =>` constrains the universal `'a` of `f: 'a. 'a => 'a` to `int => int`. |
199199
| `Constructor_arity_mismatch` || `constructor_arity_mismatch.res`, `constructor_arity_mismatch_pattern.res`, `arity_mismatch*.res` | Triggers in both expression (4028) and pattern (1426) paths. |
200+
| `Label_mismatch` || `label_mismatch_record_literal.res` | Record literal without expected type mixing fields from two different record types — disambiguation picks one type per label, and the cross-type unify fails inside `type_label_exp`. |
200201
| `Pattern_type_clash` || many `*_pattern_type_clash.res` etc. | Most-fired pattern error. Sub-case fixtures: `pattern_matching_on_option_but_value_not_option.res` and `pattern_matching_on_value_but_is_option.res` (option-vs-non-option trace), `pattern_type_clash_polyvariant.res` (polyvariant tag against concrete type), `pattern_type_clash_tuple_arity.res` (tuple arity mismatch). |
201202
| `Or_pattern_type_clash` || `or_pattern_type_clash.res` | |
202203
| `Multiply_bound_variable` || `multiply_bound_variable.res` | |
203204
| `Orpat_vars` || `orpat_vars_unbalanced.res` | |
204205
| `Expr_type_clash` || many `*.res` | Most-fired expression error. Trace-shape sub-cases covered: `if_return_type_mismatch.res` (IfReturn), `maybe_unwrap_option.res` (MaybeUnwrapOption), `string_concat_non_string.res` (StringConcat), `labeled_fn_argument_type_clash.res` (FunctionArgument with explicit label), `math_operator_*.res` (MathOperator family), `ternary_branch_mismatch.res`, `switch_different_types.res`, `try_catch_same_type.res`, `comparison_operator.res`, `array_item_type_mismatch.res`, `array_literal_passed_to_tuple.res`, `if_condition_mismatch.res`, `while_condition.res`, `for_loop_condition.res`, `assert_condition.res`, `function_call_mismatch.res`, `awaiting_non_promise.res`, multiple `jsx_*` fixtures. |
205206
| `Apply_non_function` || `apply_non_function.res` | |
206207
| `Apply_wrong_label` || `apply_wrong_label.res` | |
207-
| `Abstract_wrong_label` || `abstract_wrong_label.res` | Multi-arg function literal where an inner argument label doesn't match the expected arrow's label (e.g. `let f: (~a, ~b) => int = (~a, ~c) => …`). |
208-
| `Label_mismatch` || `label_mismatch_record_literal.res` | Record literal without expected type mixing fields from two different record types — disambiguation picks one type per label, and the cross-type unify fails inside `type_label_exp`. |
209208
| `Label_multiply_defined` || `label_multiply_defined_literal.res` | |
210209
| `Labels_missing` || `missing_label.res`, `missing_labels.res` | |
211210
| `Label_not_mutable` || `label_not_mutable.res` | |
@@ -216,14 +215,17 @@ Source: [typecore.ml:27](../compiler/ml/typecore.ml).
216215
| `Private_label` || `private_label.res` | |
217216
| `Not_subtype` || `subtype_*.res`, `dict_show_no_coercion.res`, etc. | |
218217
| `Too_many_arguments` || `too_many_arguments.res`, `moreArguments*.res` | |
218+
| `Abstract_wrong_label` || `abstract_wrong_label.res` | Multi-arg function literal where an inner argument label doesn't match the expected arrow's label (e.g. `let f: (~a, ~b) => int = (~a, ~c) => …`). |
219219
| `Scoping_let_module` || `scoping_let_module.res` | |
220220
| `Not_a_variant_type` || `variant_spread_pattern_not_a_variant.res` | Pattern-level variant spread of a non-variant type. |
221+
| `Incoherent_label_order` || `labeled_args_incoherent_order.res` | A not-yet-generalized function value applied more than once with labelled args in conflicting orders (`g => (g(~a, ~b), g(~b, ~a))`); the reordered second call hits the leftover/tvar path in `type_unknown_args`. |
221222
| `Less_general` || `less_general_universal.res` | |
222223
| `Modules_not_allowed` || `super_errors_multi/Modules_not_allowed_toplevel` | Toplevel `let module(M) = …` pattern with `allow_modules=false`. |
223224
| `Cannot_infer_signature` || `cannot_infer_signature.res` | |
224225
| `Not_a_packed_module` || `not_a_packed_module.res` | |
225226
| `Unexpected_existential` || `super_errors_multi/Unexpected_existential_in_let` | Destructuring GADT constructor with existential in toplevel `let`. |
226227
| `Unqualified_gadt_pattern` || `super_errors_multi/Cross_gadt_pattern` | Only reachable via cross-module GADT disambiguation; in single-file matching the constructor would resolve before this check. |
228+
| `Invalid_interval` || `pattern_interval_non_char.res` | Non-char constant interval pattern (e.g. `1 .. 5`); the parser builds `Ppat_interval` and only the `Pconst_char` interval is rewritten. |
227229
| `Invalid_for_loop_index` || `invalid_for_loop_index.res` | |
228230
| `No_value_clauses` || `no_value_clauses.res` | |
229231
| `Exception_pattern_below_toplevel` || `exception_pattern_below_toplevel.res` | |
@@ -260,6 +262,9 @@ Type-declaration errors. Source: [typedecl.ml:27](../compiler/ml/typedecl.ml).
260262
| `Definition_mismatch` || `definition_mismatch.res` | |
261263
| `Constraint_failed` || `constraint_failed.res` | |
262264
| `Inconsistent_constraint` || `inconsistent_constraint.res` | |
265+
| `Type_clash` ||| Appears dead; retained pending proof. `update_type` unifies `t<fresh>` against `t`'s own manifest (an alpha-renamed copy of itself), which can't head-clash; real inconsistencies hit `Cycle_in_def`/`Recursive_abbrev`/`Parameters_differ` first. ~37 shapes tried without reaching it. |
266+
| `Parameters_differ` || `recursive_type_parameters_differ.res` | Non-uniform recursion through an object/record manifest (`type rec t<'a> = {"f": t<int>}`), caught by `check_regular` rather than `Cycle_in_def`. |
267+
| `Null_arity_external` || `external_null_arity.res` | External whose name starts with `?` (e.g. `external x: int = "?nodeFs"`) skips the magic `prim_native_name` encoding and reaches the typer with arity 0. |
263268
| `Unbound_type_var` || `unbound_type_var.res` | |
264269
| `Cannot_extend_private_type` || `cannot_extend_private_type.res` | |
265270
| `Not_extensible_type` || `not_extensible_type.res` | |
@@ -269,7 +274,9 @@ Type-declaration errors. Source: [typedecl.ml:27](../compiler/ml/typedecl.ml).
269274
| `Rebind_private` || `extension_rebind_private.res` | Rebinding a private extension constructor as public. |
270275
| `Bad_variance` || `bad_variance.res`, `bad_variance_contra.res` | |
271276
| `Unavailable_type_constructor` | ☐ (needs build harness) || typedecl.ml:778. Requires a type path findable at parse time but missing during constraint enforcement; only cross-unit scenarios where a `.cmi` was found but later removed. |
277+
| `Bad_fixed_type` || `fixed_type_no_row_variable.res` | Fully-bounded closed private polymorphic variant (`type t = private [< #A | #B > #A #B]`) satisfies `is_fixed_type` but has a static (non-`Tvar`) row. |
272278
| `Unbound_type_var_ext` || `unbound_type_var_extension.res` | |
279+
| `Varying_anonymous` || `gadt_varying_anonymous.res` | Variance annotation on a GADT parameter whose return type constrains it (`type rec t<+'a> = K(int): t<int>`). |
273280
| `Invalid_attribute` || `invalid_attribute_not_undefined.res` | |
274281
| `Bad_immediate_attribute` || `bad_immediate_attribute.res` | |
275282
| `Bad_unboxed_attribute` || `bad_unboxed_attribute_abstract.res`, `bad_unboxed_attribute_mutable.res`, `bad_unboxed_attribute_many_fields.res`, `bad_unboxed_attribute_extensible.res` | All 4 sub-cases covered. |
@@ -318,6 +325,7 @@ Type-expression errors. Source: [typetexp.ml:28](../compiler/ml/typetexp.ml).
318325
|---|---|---|---|
319326
| `Unbound_type_variable` || (covered indirectly via many fixtures) | |
320327
| `Unbound_type_constructor` || `typetexp_unbound_type_constructor.res` | |
328+
| `Unbound_type_constructor_2` || `incomplete_type_constructor_polyvariant.res`, `incomplete_type_constructor_object.res` | Identity alias `type t<'a> = 'a` used in an inherit position with a type-variable arg; `expand_head` collapses `t<'b>` to a bare `Tvar` while the repr stays `Tconstr`. Reachable from poly-variant inherit and object spread. |
321329
| `Type_arity_mismatch` || `type_arity_mismatch.res` | |
322330
| `Type_mismatch` || `typetexp_type_mismatch.res` | Type-constructor application that violates a `constraint 'a = …` on the declaration. |
323331
| `Alias_type_mismatch` || `typetexp_alias_type_mismatch.res` | |
@@ -476,6 +484,7 @@ Environment / `.cmi`-consistency errors. Source: [env.ml:57](../compiler/ml/env.
476484
| `Illegal_renaming` | ☐ (needs build harness) || Triggered when a `.cmi` filename and the module name inside it disagree. Reachable via `rescript.json` setups that rename the produced artefact, but not from a single-process `bsc` invocation that always writes `Module.cmi` to match the source. |
477485
| `Inconsistent_import` | ☐ (needs build harness) || Triggered when two `.cmi` files transitively imported by the same unit declare different CRCs for the same type. Needs an artificially-mutated build state across multiple compile invocations. |
478486
| `Missing_module` | ☐ (needs build harness) || `.cmi` referenced but absent from `-I` paths at compile time. The `super_errors_multi` runner pre-compiles every fixture file via `-bs-read-cmi`, so it never reaches this code path. |
487+
| `Illegal_value_name` || `illegal_value_name.res` | Escaped identifier reaching `check_value_name` during definition (`let \"->" = 1`); the parser does not reject `\"->"`. |
479488

480489
---
481490

0 commit comments

Comments
 (0)