Skip to content

Commit b5ea912

Browse files
antalszlpw25
authored andcommitted
Make empty types immediate
1 parent bc08236 commit b5ea912

2 files changed

Lines changed: 2 additions & 11 deletions

File tree

testsuite/tests/typing-immediate/immediate.ml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,7 @@ module FM_valid : S
5757
(* Valid for empty types *)
5858
module Empty_valid : S = struct type t = | end;;
5959
[%%expect{|
60-
Line 1, characters 25-46:
61-
1 | module Empty_valid : S = struct type t = | end;;
62-
^^^^^^^^^^^^^^^^^^^^^
63-
Error: Signature mismatch:
64-
Modules do not match: sig type t = | end is not included in S
65-
Type declarations do not match:
66-
type t = |
67-
is not included in
68-
type t [@@immediate]
69-
The first is not an immediate type.
60+
module Empty_valid : S
7061
|}];;
7162

7263
(* Practical usage over modules *)

typing/typedecl_immediacy.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ let compute_decl env tdecl =
3333
| Type_immediacy.Always -> Type_immediacy.Always_on_64bits
3434
| Type_immediacy.Always_on_64bits | Type_immediacy.Unknown as x -> x
3535
end
36-
| (Type_variant (_ :: _ as cstrs), _) ->
36+
| (Type_variant cstrs, _) ->
3737
if not (List.exists (fun c -> c.Types.cd_args <> Types.Cstr_tuple []) cstrs)
3838
then
3939
Type_immediacy.Always

0 commit comments

Comments
 (0)