Skip to content

Make local extension point equivalent to local_ expression #790

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
Aug 29, 2022
Merged
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
9 changes: 6 additions & 3 deletions ocaml/typing/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2864,7 +2864,8 @@ let is_local_returning_expr e =
let rec loop e =
match e.pexp_desc with
| Pexp_apply
({ pexp_desc = Pexp_extension({txt = "extension.local"}, PStr []) },
({ pexp_desc = Pexp_extension(
{txt = "extension.local"|"ocaml.local"|"local"}, PStr []) },
[Nolabel, _]) ->
true, e.pexp_loc
| Pexp_ident _ | Pexp_constant _ | Pexp_apply _ | Pexp_tuple _
Expand Down Expand Up @@ -2993,7 +2994,8 @@ let rec type_approx env sexp =
end;
ty2
| Pexp_apply
({ pexp_desc = Pexp_extension({txt = "extension.local"}, PStr []) },
({ pexp_desc = Pexp_extension(
{txt = "extension.local"|"ocaml.local"|"local"}, PStr []) },
[Nolabel, e]) ->
type_approx env e
| Pexp_apply
Expand Down Expand Up @@ -5858,7 +5860,8 @@ and type_let
| Pexp_constraint (e, _)
| Pexp_newtype (_, e)
| Pexp_apply
({ pexp_desc = Pexp_extension({txt = "extension.local"}, PStr []) },
({ pexp_desc = Pexp_extension(
{txt = "extension.local"|"ocaml.local"|"local"}, PStr []) },
[Nolabel, e]) -> sexp_is_fun e
| _ -> false
in
Expand Down