Skip to content

Commit 6d45b43

Browse files
authored
super_errors: error variant catalog + final fixture sweep (#8446)
1 parent 07363d5 commit 6d45b43

112 files changed

Lines changed: 1344 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,25 @@ tests/
168168
2. **Integration tests** (`tests/tests/`) - End-to-end behavior
169169
3. **Unit tests** (`tests/ounit_tests/`) - Compiler functions
170170
4. **Build tests** (`tests/build_tests/`) - Error cases and edge cases
171-
5. **Type tests** (`tests/build_tests/super_errors/`) - Type checking behavior
171+
5. **Type tests** (`tests/build_tests/super_errors/`) - Single-file type checking errors
172+
6. **Multi-file error tests** (`tests/build_tests/super_errors_multi/`) - Cross-module errors that need separate `.res` / `.resi` files
173+
174+
#### Error variant catalog
175+
176+
[`tests/ERROR_VARIANTS.md`](tests/ERROR_VARIANTS.md) is a per-module
177+
catalog of every error and warning variant the compiler can emit, with
178+
each entry mapped to a fixture (or a documented reason it's unreachable).
179+
180+
**When adding or removing an error variant**, also update the catalog:
181+
182+
1. Add (or remove) the row in the relevant module section.
183+
2. Set the status (`` covered / `` unreachable / `` TODO).
184+
3. If covered, link the fixture path; if unreachable, note the reason.
185+
186+
**When adding or removing a fixture**, update the corresponding row's
187+
`Fixture` and status columns so the catalog stays in sync with the test
188+
suite. The catalog is the primary tool for finding coverage gaps and
189+
dead-code removal candidates; stale entries make both jobs harder.
172190

173191
## Build Commands & Development
174192

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
- Expand `super_errors` fixture coverage for the remaining reachable single-file error variants. https://github.com/rescript-lang/rescript/pull/8432
5454
- Cache OPAM env, rewatch build, and instrumented dune state in the coverage workflow. https://github.com/rescript-lang/rescript/pull/8434
5555
- Add a multi-file fixture harness (`super_errors_multi`) for cross-module errors and warnings. https://github.com/rescript-lang/rescript/pull/8433
56+
- Catalog every named compiler error variant in `tests/ERROR_VARIANTS.md` and add fixtures for the remaining reachable ones. https://github.com/rescript-lang/rescript/pull/8446
5657

5758

5859
# 13.0.0-alpha.4

tests/ERROR_VARIANTS.md

Lines changed: 605 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedAtMostOneBigint.res:2:20-30
4+
5+
1 │ @unboxed
6+
2 │ type t = A(bigint) | B(bigint)
7+
3 │
8+
9+
This untagged variant definition is invalid: At most one case can be a bigint type.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedAtMostOneBoolean.res:2:18-26
4+
5+
1 │ @unboxed
6+
2 │ type t = A(bool) | B(bool)
7+
3 │
8+
9+
This untagged variant definition is invalid: At most one case can be a boolean type.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedAtMostOneFunction.res:2:24-44
4+
5+
1 │ @unboxed
6+
2 │ type t = A(int => int) | B(string => string)
7+
3 │
8+
9+
This untagged variant definition is invalid: At most one case can be a function type.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedAtMostOneInstance.res:2:20-30
4+
5+
1 │ @unboxed
6+
2 │ type t = A(Date.t) | B(Date.t)
7+
3 │
8+
9+
This untagged variant definition is invalid: At most one case can be a Date type.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedAtMostOneNumber.res:2:17-26
4+
5+
1 │ @unboxed
6+
2 │ type t = A(int) | B(float)
7+
3 │
8+
9+
This untagged variant definition is invalid: At most one case can be a number type (int or float).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedAtMostOneObject.res:4:15-20
4+
5+
2 │ type b = {y: int}
6+
3 │ @unboxed
7+
4 │ type t = A(a) | B(b)
8+
5 │
9+
10+
This untagged variant definition is invalid: At most one case can be an object type.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
We've found a bug for you!
3+
/.../fixtures/UntaggedConstructorMoreThanOneArg.res:2:1-32
4+
5+
1 │ @unboxed
6+
2 │ type t = A(int, int) | B(string)
7+
3 │
8+
9+
This untagged variant definition is invalid: Constructor A has more than one argument.

0 commit comments

Comments
 (0)