Skip to content

Remove leftover ident_uncurried/path_uncurried #7467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions compiler/ml/error_message_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@ let type_clash_context_maybe_option ty_expected ty_res =
| ( {Types.desc = Tconstr (expected_path, _, _)},
{Types.desc = Tconstr (type_path, _, _)} )
when Path.same Predef.path_option type_path
&& Path.same expected_path Predef.path_option = false
&& Path.same expected_path Predef.path_uncurried = false ->
&& Path.same expected_path Predef.path_option = false ->
Some MaybeUnwrapOption
| _ -> None

Expand Down
21 changes: 2 additions & 19 deletions compiler/ml/predef.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,14 @@ and ident_unknown = ident_create "unknown"

and ident_promise = ident_create "promise"

and ident_uncurried = ident_create "function$"

type test = For_sure_yes | For_sure_no | NA

let type_is_builtin_path_but_option (p : Path.t) : test =
match p with
| Pident {stamp} when stamp = ident_option.stamp -> For_sure_no
| Pident {stamp} when stamp = ident_unit.stamp -> For_sure_no
| Pident {stamp}
when stamp >= ident_int.stamp && stamp <= ident_uncurried.stamp ->
| Pident {stamp} when stamp >= ident_int.stamp && stamp <= ident_promise.stamp
->
For_sure_yes
| _ -> NA

Expand Down Expand Up @@ -110,8 +108,6 @@ and path_extension_constructor = Pident ident_extension_constructor

and path_promise = Pident ident_promise

and path_uncurried = Pident ident_uncurried

let type_int = newgenty (Tconstr (path_int, [], ref Mnil))

and type_char = newgenty (Tconstr (path_char, [], ref Mnil))
Expand Down Expand Up @@ -233,8 +229,6 @@ and ident_some = ident_create "Some"

and ident_ctor_unknown = ident_create "Unknown"

and ident_ctor_uncurried = ident_create "Function$"

let common_initial_env add_type add_extension empty_env =
let decl_bool =
{
Expand Down Expand Up @@ -319,16 +313,6 @@ let common_initial_env add_type add_extension empty_env =
],
Record_regular );
}
and decl_uncurried =
let tvar1 = newgenvar () in
{
decl_abstr with
type_params = [tvar1];
type_arity = 1;
type_kind = Type_variant [cstr ident_ctor_uncurried [tvar1]];
type_variance = [Variance.covariant];
type_unboxed = Types.unboxed_true_default_false;
}
and decl_unknown =
let tvar = newgenvar () in
{
Expand Down Expand Up @@ -395,7 +379,6 @@ let common_initial_env add_type add_extension empty_env =
|> add_type ident_unit decl_unit
|> add_type ident_extension_constructor decl_abstr
|> add_type ident_exn decl_exn
|> add_type ident_uncurried decl_uncurried
|> add_type ident_option decl_option
|> add_type ident_result decl_result
|> add_type ident_lazy_t decl_lazy_t
Expand Down
1 change: 0 additions & 1 deletion compiler/ml/predef.mli
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ val path_bigint : Path.t
val path_lazy_t : Path.t
val path_extension_constructor : Path.t
val path_promise : Path.t
val path_uncurried : Path.t

val path_match_failure : Path.t
val path_assert_failure : Path.t
Expand Down