Skip to content

Commit 983a9e7

Browse files
committed
Untagged variants: consider regexp as an object type.
Fixes #6140
1 parent 21d9eaa commit 983a9e7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
- Introduced a new `%ffi` extension (*experimental* - not for production use!) 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. https://github.com/rescript-lang/rescript-compiler/pull/6251
1818
- Extended untagged variants with function types. https://github.com/rescript-lang/rescript-compiler/pull/6279
19+
- Untagged variants: consider regexp as an object type. https://github.com/rescript-lang/rescript-compiler/pull/6296
1920

2021
#### :boom: Breaking Change
2122

jscomp/ml/ast_untagged_variants.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ let type_is_builtin_object (t : Types.type_expr) =
117117
match t.desc with
118118
| Tconstr (path, _, _) ->
119119
let name = Path.name path in
120-
name = "Js.Dict.t" || name = "Js_dict.t"
120+
name = "Js.Dict.t" || name = "Js_dict.t" || name = "Js.Re.t" || name = "RescriptCore.Re.t"
121121
| _ -> false
122122

123123
let get_block_type ~env (cstr : Types.constructor_declaration) :

0 commit comments

Comments
 (0)