Skip to content

Commit

Permalink
Basic example with disabling warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
d-kalinichenko committed May 16, 2024
1 parent d280cef commit a6c98cc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ocaml/testsuite/tests/typing-layouts/erasable_annot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -481,3 +481,26 @@ external f_4 : M3.t -> M3.t = "%identity" [@@unboxed]
module M3 : sig type t = private float# end
external f_4 : M3.t -> M3.t = "%identity" [@@unboxed]
|}];;

(* Disabling warnings *)

module M4 : sig
[@@@warning "-187"]
type ('a : immediate) t = Something of 'a

val f : ('a : immediate). 'a t -> 'a
end = struct
[@@@warning "-187"]

type ('a : immediate) t = Something of 'a

let f (Something x) = x
end;;

[%%expect{|
module M4 :
sig
type ('a : immediate) t = Something of 'a
val f : ('a : immediate). 'a t -> 'a
end
|}]

0 comments on commit a6c98cc

Please sign in to comment.