Skip to content

Commit 12671e8

Browse files
committed
Fix issue where uncurried type internals leak in type error.
Fixes #6263
1 parent c72928e commit 12671e8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
- Introduced a new `%ffi` extension that provides a more robust mechanism for JavaScript function interoperation by considering function arity in type constraints. This enhancement improves safety when dealing with JavaScript functions by enforcing type constraints based on the arity of the function. [PR #6251](https://github.com/rescript-lang/rescript-compiler/pull/6251)
1818

19+
#### :bug: Bug Fix
20+
21+
- Fix issue where uncurried type internals leak in type error.
22+
23+
1924
# 11.0.0-beta.1
2025

2126
#### :rocket: Main New Feature

jscomp/syntax/src/res_outcome_printer.ml

+3
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ let rec printOutTypeDoc (outType : Outcometree.out_type) =
217217
->
218218
(* function$<(int, int) => int, [#2]> -> (. int, int) => int *)
219219
printOutArrowType ~uncurried:true arrowType
220+
| Otyp_constr (Oide_ident "function$", [Otyp_var _; _arity]) ->
221+
(* function$<'a, arity> -> _ => _ *)
222+
printOutTypeDoc (Otyp_stuff "_ => _")
220223
| Otyp_constr (outIdent, []) -> printOutIdentDoc ~allowUident:false outIdent
221224
| Otyp_manifest (typ1, typ2) ->
222225
Doc.concat [printOutTypeDoc typ1; Doc.text " = "; printOutTypeDoc typ2]

0 commit comments

Comments
 (0)