Skip to content

Commit 2983040

Browse files
committed
Merge ocaml-jst#97 (#1063)
1 parent 15bc880 commit 2983040

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

ocaml/testsuite/tests/typing-local/crossing.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,4 +343,4 @@ module M : sig type t [@@immediate] end
343343
type t2 = { x : int; } [@@unboxed]
344344
val f : local_ M.t -> M.t = <fun>
345345
val f : local_ t2 -> t2 = <fun>
346-
|}]
346+
|}]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(* TEST
2+
* arch64
3+
** expect *)
4+
5+
(* Mode crossing works on immediate64 types *)
6+
module F (M : sig type t [@@immediate64] end) = struct
7+
let f : local_ M.t -> _ = fun t -> t
8+
end
9+
10+
[%%expect{|
11+
module F :
12+
functor (M : sig type t [@@immediate64] end) ->
13+
sig val f : local_ M.t -> M.t end
14+
|}]

ocaml/typing/typecore.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ let mode_cross env (ty : type_expr) mode =
559559
if is_principal ty then begin
560560
match immediacy env ty with
561561
| Type_immediacy.Always -> Value_mode.newvar ()
562-
| Type_immediacy.Always_on_64bits when !Clflags.native_code && Sys.word_size = 64 ->
562+
| Type_immediacy.Always_on_64bits when Sys.word_size = 64 ->
563563
Value_mode.newvar () (* floating and relaxed *)
564564
| _ -> mode
565565
end

0 commit comments

Comments
 (0)