super_errors: round two of error fixture coverage#8432
Open
JonoPrest wants to merge 34 commits into
Open
Conversation
…nvalid_for_loop_index, Field_access_on_dict_type, Private_label
…, Constraint_failed
…e_module_require_explicit_type
…recmodule Circular_dependency
…ld, Value_descriptions, Type_declarations)
…tension_constructor_payload, Inlined_record_expected
…_extend_private_type
…und_label, Unbound_modtype
… and With_mismatch
…ng_type, Invalid_bs_unwrap_type
…emod Module_types, Extension_constructors
…_mismatch, typedecl Inconsistent_constraint
…r_signature, typedecl Bad_variance
…ctor_arity_mismatch in pattern context
…on-abstract type
…, Expect_opt_in_bs_return_to_opt, Illegal_attribute
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #8432 +/- ##
==========================================
+ Coverage 59.10% 59.92% +0.82%
==========================================
Files 373 373
Lines 54210 54210
==========================================
+ Hits 32040 32487 +447
+ Misses 22170 21723 -447 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
super_errors: round two of error fixture coverage
Builds on #8429 (jono/expand-coverage). Same playbook — one
.resfile pererror variant — applied to the variants that branch missed.
~75 new single-file fixtures across 33 commits, covering every reachable
single-file error variant in
typecore,typedecl,typemod,typetexp,includemod,translcore,translmod,transl_recmodule,rec_check, andbs_syntaxerr.After this round, what remains either requires multi-file setups (separate
follow-up) or is dead code in the current parser / compiler. Both lists are
written down below so reviewers don't have to re-derive them.
Coverage impact
Measured locally with
make coverage(bisect_ppx point coverage). Baseline isupstream/master after #8429 was merged.
Per-file moves on the modules this branch targets:
compiler/ml/transl_recmodule.mlcompiler/frontend/bs_syntaxerr.mlcompiler/ml/typemod.mlcompiler/ml/rec_check.mlcompiler/ml/typetexp.mlcompiler/ml/typedecl.mlcompiler/ml/includemod.mlcompiler/frontend/ast_attributes.mlcompiler/ml/translmod.mlcompiler/frontend/ast_external_process.mlcompiler/ml/typecore.mlcompiler/ml/translcore.mlWhat's covered
typecore — Label_not_mutable, Apply_non_function, Invalid_for_loop_index,
Field_access_on_dict_type, Private_label, Not_an_extension_constructor,
Invalid_extension_constructor_payload, Inlined_record_expected, Less_general,
Constructor_arity_mismatch (expression + pattern), Private_type construction,
let-module scope escape, Cannot_infer_signature, Undefined_method.
typedecl — Boxed_and_unboxed, Bad_unboxed_attribute (abstract, mutable,
many-fields, extensible), Constraint_failed, Nonrec_gadt, Not_extensible_type,
Cannot_extend_private_type, Object_spread_with_record_field,
Inconsistent_constraint, Bad_immediate_attribute, Unbound_type_var_ext,
Bad_variance (covariant + contravariant), Definition_mismatch,
Invalid_attribute (@notundefined on non-abstract), Variant_spread_fail
(non-variant source).
typemod — With_no_component, Cannot_apply,
Recursive_module_require_explicit_type, Apply_generative, With_mismatch,
Structure_expected (opening a functor), Not_a_packed_module,
Not_allowed_in_functor_body, Incomplete_packed_module, Non_generalizable.
typetexp — Unbound_value, Unbound_constructor, Unbound_label,
Unbound_modtype, Multiple_constraints_on_type, Method_mismatch,
Access_functor_as_structure, Constructor_mismatch, Not_an_object,
Opened_object, Alias_type_mismatch.
includemod — Missing_field, Value_descriptions, Type_declarations,
Module_types, Extension_constructors, Modtype_infos, Modtype_permutation.
bs_syntaxerr — Invalid_bs_int_type, Invalid_bs_string_type,
Invalid_bs_unwrap_type, Conflict_attributes, Expect_string_literal,
Expect_int_literal, Not_supported_directive_in_bs_return,
Expect_opt_in_bs_return_to_opt, Illegal_attribute.
translcore — Unknown_builtin_primitive.
translmod — Fragile_pattern_in_toplevel.
transl_recmodule — Circular_dependency.
rec_check — Illegal_letrec_expr.
Dead in modern ReScript (parser / compiler can't produce the AST shape)
Invalid_for_of_pattern— parser pre-normalizes the pattern.Polymorphic_label(typecore) — record set / match paths now succeed.Parameters_differ— variant declarations with non-uniform recursion areaccepted; abbreviations hit
Cycle_in_deffirst.Apply_structure_as_functor,Ill_typed_functor_application,Cannot_eliminate_dependency—M(N).ttype-level syntax doesn't exist,and module-level functor applications always resolve concretely.
Misplaced_label_syntax— only fires for labeled args to->/#=/##,but the parser always emits those as
Nolabel.Variant_tags— theTagsexception is defined inctype.mlbut neverraised; the path is effectively dead.
Unhandled_poly_type— parser rejects inline poly types in arrow chains.Unqualified_gadt_pattern— masked byUnbound_constructorin everynatural reproduction.
Name_type_mismatch— every reproduction lands onWrong_namefirst.Val_in_structure— requirespval_prim = [], which the parser neverproduces.
Bad_fixed_type,Unbound_type_constructor_2— behind#rowprivate-rowsyntax that isn't exposed.
Invalid_underscore_type_in_external— needs?label:_in@@objexternals; the standalone form is fine.
Cannot_quantify(typetexp) — every value-level reproduction lands onLess_generalfirst; type-level Ptyp_poly always quantifies cleanly.Recursive_local_constraint— GADT pattern that would producea cyclic local abbreviation doesn't surface this error in ReScript's
matcher.
Bs_this_simple_pattern,Optional_in_uncurried_bs_attribute,Conflict_bs_bs_this_bs_meth—@thisdoesn't parse on regular functions.Expect_int_or_string_or_json_literal— needs an@as(...)with adelimited string that isn't a valid JS literal; plain string / int /
identifier payloads all succeed.
Unsupported_predicates—@get/@setreject unknown payload shapesearlier with the generic "Invalid payload" message.
Illegal_reference_to_recursive_module— theEnv.Recmoduleexceptionisn't reachable from a single-file recmodule (the placeholder is sealed
before the type lookup runs).
With_cannot_remove_constrained_type,With_changes_module_alias,With_makes_applicative_functor_ill_typed— nichewith typepaths thatdon't fire from any single-file
with type X := ...construction I tried.ast_utf8_stringfamily (Invalid_hex_escape, Invalid_unicode_escape,Invalid_unicode_codepoint_escape, Invalid_code_point,
Unterminated_backslash) — only reachable via the legacy
{j|…|j}delimiter; backquote template strings skip the transform.
Reachable only with multi-file setups
These are real, user-facing errors but can't be triggered from one
.res:typetexp.Cannot_scrape_alias,typemod.Cannot_scrape_alias— need abroken alias chain that crosses module boundaries.
typedecl.Unavailable_type_constructor— needs a type path thatdisappears, which happens across compilation units.
typemod.Interface_not_compiled— missing.cmi, by definitionmulti-unit.
typemod.Scoping_pack,typemod.Non_generalizable_module— requiremodule sealing where types from different scopes meet.
includemod.Interface_mismatch,includemod.Invalid_module_alias,includemod.Unbound_modtype_path,includemod.Unbound_module_path— allfire only across module / file boundaries.
These motivate the multi-file harness follow-up — same playbook (one fixture
per error variant) but compiling a directory tree per fixture instead of one
file.
Closing claim
This is now exhaustive for single-file
super_errorsfixtures. Everyremaining error variant in the modules above either has a fixture, has a
written-down reason it can't be triggered from one file, or is dead code.