Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
ff6ba0d
super_errors_multi: add multi-file fixture harness with 4 smoke fixtures
JonoPrest May 20, 2026
35e019d
super_errors_multi: cover Includemod variants through compunit (.resi…
JonoPrest May 20, 2026
ba0a78a
super_errors_multi: cover cross-module type / record / constructor di…
JonoPrest May 20, 2026
cf5519f
super_errors_multi: cover cross-module external, private constructor,…
JonoPrest May 20, 2026
98b3e68
super_errors_multi: drop orphan JSX expected snapshot
JonoPrest May 20, 2026
d8e76af
super_errors_multi: cover cross-module deprecation, open-shadows, lab…
JonoPrest May 20, 2026
9ec1405
super_errors_multi: cover typemod Interface_not_compiled
JonoPrest May 20, 2026
41c388f
super_errors_multi: cover cross-module exception, record extra field,…
JonoPrest May 20, 2026
441fd51
super_errors_multi: cover inline record constructor, variant spread, …
JonoPrest May 20, 2026
9fc9698
super_errors_multi: cover interface-hidden record access, uncurried a…
JonoPrest May 20, 2026
e504fee
super_errors_multi: cover typecore Unqualified_gadt_pattern via cross…
JonoPrest May 20, 2026
024707c
super_errors_multi: cover typecore Modules_not_allowed and Unexpected…
JonoPrest May 20, 2026
fec7103
super_errors_multi: cover includecore Privacy, Field_mutable, Field_o…
JonoPrest May 20, 2026
24cef59
super_errors_multi: cover includecore Variant_representation via diff…
JonoPrest May 20, 2026
492fbcc
Update changelog for #8433
JonoPrest May 20, 2026
dcd0c8e
super_errors_multi: lowercase `.cmi` basenames in snapshot post-proce…
JonoPrest May 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
- Expand `super_errors` fixture coverage for warnings and errors. https://github.com/rescript-lang/rescript/pull/8429
- Run `super_errors` fixtures in parallel (~2.4× faster locally). https://github.com/rescript-lang/rescript/pull/8430
- Expand `super_errors` fixture coverage for the remaining reachable single-file error variants. https://github.com/rescript-lang/rescript/pull/8432
- Add a multi-file fixture harness (`super_errors_multi`) for cross-module errors and warnings. https://github.com/rescript-lang/rescript/pull/8433


# 13.0.0-alpha.4
Expand Down
2 changes: 1 addition & 1 deletion scripts/format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo Formatting OCaml code...
opam exec -- dune build @fmt --auto-promote

echo Formatting ReScript code...
files=$(find packages tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/build_tests/super_errors/fixtures/break_keyword_binding.res" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
files=$(find packages tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/build_tests/super_errors/fixtures/break_keyword_binding.res" ! -path "tests/build_tests/super_errors_multi/fixtures/Iface_not_compiled/*" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
./cli/rescript.js format $files

echo Formatting JS code...
Expand Down
2 changes: 1 addition & 1 deletion scripts/format_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ case "$(uname -s)" in
fi

echo "Checking ReScript code formatting..."
files=$(find packages tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/build_tests/super_errors/fixtures/break_keyword_binding.res" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
files=$(find packages tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -name "generated_mocha_test.res" ! -path "tests/build_tests/super_errors/fixtures/break_keyword_binding.res" ! -path "tests/build_tests/super_errors_multi/fixtures/Iface_not_compiled/*" ! -path "tests/syntax_tests*" ! -path "tests/analysis_tests/tests*" ! -path "*/node_modules/*")
if ./cli/rescript.js format --check $files; then
printf "${successGreen}✅ ReScript code formatting ok.${reset}\n"
else
Expand Down
6 changes: 6 additions & 0 deletions tests/build_tests/super_errors_multi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fixtures/**/*.cmi
fixtures/**/*.cmj
fixtures/**/*.cmt
fixtures/**/*.cmti
fixtures/**/*.mjs
fixtures/**/*.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_abstract_type_construction/User.res:1:18

1 │ let bad: Abs.t = 1
2 │

This has type: int
But it's expected to have type: Abs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_async_promise_mismatch/User.res:1:29-44

1 │ let consume = (): string => Lib.fetch("api")
2 │

This has type: promise<string>
But it's expected to have type: string

- Did you mean to await this promise before using it?
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===== C.res =====

We've found a bug for you!
/.../fixtures/Cross_chain_of_aliases/C.res:1:23-29

1 │ let v: B.Reexport.t = "wrong"
2 │

This has type: string
But it's expected to have type: B.Reexport.t (defined as int)

You can convert string to int with Int.fromString.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_dependent_clash/User.res:1:21-34

1 │ let _ = Sender.send({to_: "alice"})
2 │

Some required record fields are missing: body.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===== User.res =====

Warning number 3
/.../fixtures/Cross_deprecated_type/User.res:1:8-15

1 │ let v: Legacy.t = 1
2 │

deprecated: Legacy.t
Use newType instead
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===== User.res =====

Warning number 3
/.../fixtures/Cross_deprecated_value/User.res:1:9-22

1 │ let x = Legacy.compute(1)
2 │

deprecated: Legacy.compute
Use computeNew instead
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
===== User.res =====

Warning number 8
/.../fixtures/Cross_dict_pattern/User.res:2:3-4:3

1 │ let read = (cfg: Defs.config) =>
2 │ switch cfg {
3 │  | dict{"port": p} => p
4 │  }
5 │

You forgot to handle a possible case here, for example:
| {port: ?None}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_exception_arity_mismatch/User.res:1:28-52

1 │ let raise_it = () => throw(Errors.ParseError("oops"))
2 │

This variant constructor Errors.ParseError expects 2 arguments, but it's only being passed 1.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_external_argument_clash/User.res:1:22-23

1 │ let x = Ffi.parseInt(42)
2 │

This has type: int
But this function argument is expecting: string

You can convert int to string with Int.toString.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_gadt_pattern/User.res:3:5-7

1 │ let bad: Gadt.t<int> => string = x =>
2 │ switch x {
3 │ | Int(n) => n
4 │ | Pair(_, _) => "pair"
5 │ }

The GADT constructor Int of type Gadt.t must be qualified in this pattern.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_hidden_through_interface/User.res:2:16

1 │ let v = Defs.make()
2 │ let leaked = v.x
3 │

You're trying to access the record field x, but the thing you're trying to access it on is not a record.

The type of the thing you're trying to access it on is:

Defs.t


Only records have fields that can be accessed with dot notation.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_inline_record_constructor/User.res:1:9-23

1 │ let v = Defs.Pair(1, 2)
2 │

This constructor expects an inlined record argument.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_module_alias_dot_access/User.res:3:21-26

1 │ module S = Lib.Settings
2 │
3 │ let port = S.port + S.host
4 │

The value host can't be found in S
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
===== User.res =====

Warning number 45
/.../fixtures/Cross_module_open_shadow_label_constructor/User.res:5:1-6

3 │ | Bar
4 │
5 │ open A
6 │
7 │ let v = Foo

this open statement shadows the constructor Foo (which is later used)


Warning number 41
/.../fixtures/Cross_module_open_shadow_label_constructor/User.res:7:9-11

5 │ open A
6 │
7 │ let v = Foo
8 │

Foo belongs to several types: A.t t
The first one was selected. Disambiguate if this is wrong.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_module_record_disambiguation/User.res:1:19-23

1 │ let r: Point.t = {width: 1, height: 2}
2 │

The field width does not belong to type Point.t

This record expression is expected to have type Point.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_module_type_only_no_impl/User.res:1:17-23

1 │ let x: string = Iface.v
2 │

This has type: int
But it's expected to have type: string

You can convert int to string with Int.toString.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
===== User.res =====

Warning number 44
/.../fixtures/Cross_open_shadows_identifier/User.res:2:1-6

1 │ let answer = "outer"
2 │ open A
3 │ let _ = answer
4 │

this open statement shadows the value identifier answer (which is later used)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_optional_label_omitted/User.res:1:9-17

1 │ let s = Lib.greet()
2 │

This function call is incorrect.
The function has type:
(~name: string, ~greeting: string=?, unit) => string

- Missing arguments that must be provided: ~name
- Hint: Did you want to partially apply the function? You can do that by putting `...` just before the closing parens of the function call. Example: yourFn(~arg1=someVar, ...)
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_polyvariant_constraint/User.res:1:19-25

1 │ let v = Spec.pick(#Purple)
2 │

This has type: [> #Purple]
But this function argument is expecting: Spec.allowed

The second polymorphic variant is closed and doesn't include the constructor: #Purple.

Possible solutions:
- Either make the second variant open so it can accept additional constructors. To do this, make sure the type starts with [> instead of [
- Or add the missing constructor to it.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
===== Result.res =====

Warning number 37
/.../fixtures/Cross_private_constructor_pattern/Result.res:1:1-3:11

1 │ type t =
2 │  | Loaded(string)
3 │  | Loading
4 │
5 │ let loaded = s => Loaded(s)

constructor Loading is never used to build values.
Its type is exported as a private type.


===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_private_constructor_pattern/User.res:1:9-21

1 │ let x = Result.Loaded("hello")
2 │

The variant constructor Result.Loaded can't be found.

- If it's defined in another module or file, bring it into scope by:
- Prefixing it with said module name: TheModule.Result.Loaded
- Or specifying its type: let theValue: TheModule.theType = Result.Loaded
- Constructors and modules are both capitalized. Did you want the latter?
Then instead of let foo = Bar, try module Foo = Bar.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_qualified_constructor_mismatch/User.res:1:18-26

1 │ let v: Shape.t = Color.Red
2 │

The constructor Color.Red belongs to the variant type Color.t
but a constructor was expected belonging to the variant type Shape.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_record_extra_field/User.res:1:30-34

1 │ let r: Defs.t = {a: 1, b: 2, extra: 3}
2 │

The field extra does not belong to type Defs.t

This record expression is expected to have type Defs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
===== User.res =====

We've found a bug for you!
/.../fixtures/Cross_uncurried_arity/User.res:1:23-29

1 │ let bad: int => int = Lib.add
2 │

This function is expected to have 1 argument, but has 3
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
===== User.res =====

Warning number 33
/.../fixtures/Cross_unused_open/User.res:1:1-12

1 │ open Helpers
2 │
3 │ let v = 42

unused open Helpers.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
===== Ext.res =====

We've found a bug for you!
/.../fixtures/Cross_variant_spread/Ext.res:3:8-13

1 │ type t =
2 │ | A
3 │ | ...Base.t
4 │ | C
5 │

Variant Base.t has a constructor named A, but a constructor named A already exists in the variant it's spread into.
You cannot spread variants with overlapping constructors.
Loading
Loading