Skip to content

Merge ocaml-jst#97 #1063

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 2 commits into from
Jan 11, 2023
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
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/typing-local/crossing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -343,4 +343,4 @@ module M : sig type t [@@immediate] end
type t2 = { x : int; } [@@unboxed]
val f : local_ M.t -> M.t = <fun>
val f : local_ t2 -> t2 = <fun>
|}]
|}]
14 changes: 14 additions & 0 deletions ocaml/testsuite/tests/typing-local/crossing_64.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(* TEST
* arch64
** expect *)

(* Mode crossing works on immediate64 types *)
module F (M : sig type t [@@immediate64] end) = struct
let f : local_ M.t -> _ = fun t -> t
end

[%%expect{|
module F :
functor (M : sig type t [@@immediate64] end) ->
sig val f : local_ M.t -> M.t end
|}]
2 changes: 1 addition & 1 deletion ocaml/typing/typecore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ let mode_cross env (ty : type_expr) mode =
if is_principal ty then begin
match immediacy env ty with
| Type_immediacy.Always -> Value_mode.newvar ()
| Type_immediacy.Always_on_64bits when !Clflags.native_code && Sys.word_size = 64 ->
| Type_immediacy.Always_on_64bits when Sys.word_size = 64 ->
Value_mode.newvar () (* floating and relaxed *)
| _ -> mode
end
Expand Down