From 482c09cefd47e0e6af460c0074266f9cbcac559d Mon Sep 17 00:00:00 2001 From: Cristiano Calcagno Date: Thu, 8 Jun 2023 15:01:40 +0200 Subject: [PATCH] Untagged variants: consider regexp as an object type. Fixes https://github.com/rescript-lang/rescript-compiler/issues/6140 --- CHANGELOG.md | 3 +++ jscomp/ml/ast_untagged_variants.ml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 322d898ece..b9e6a124a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ # 11.0.0-beta.3 (Unreleased) +#### :rocket: New Feature +- Untagged variants: consider regexp as an object type. https://github.com/rescript-lang/rescript-compiler/pull/6296 + # 11.0.0-beta.2 #### :rocket: New Feature diff --git a/jscomp/ml/ast_untagged_variants.ml b/jscomp/ml/ast_untagged_variants.ml index ef686d1f2e..e95f9f8764 100644 --- a/jscomp/ml/ast_untagged_variants.ml +++ b/jscomp/ml/ast_untagged_variants.ml @@ -117,7 +117,7 @@ let type_is_builtin_object (t : Types.type_expr) = match t.desc with | Tconstr (path, _, _) -> let name = Path.name path in - name = "Js.Dict.t" || name = "Js_dict.t" + name = "Js.Dict.t" || name = "Js_dict.t" || name = "Js.Re.t" || name = "RescriptCore.Re.t" | _ -> false let get_block_type ~env (cstr : Types.constructor_declaration) :