···345345Warning 34 [unused-type-declaration]: unused type t.
346346module Unused_constructor_disable_warning : sig end
347347|}]
348348+349349+350350+module Unused_record : sig end = struct
351351+ type t = { a : int; b : int }
352352+ let foo (x : t) = x
353353+ let _ = foo
354354+end;;
355355+[%%expect {|
356356+module Unused_record : sig end
357357+|}]
358358+359359+module Unused_field : sig end = struct
360360+ type t = { a : int }
361361+ let foo () = { a = 0 }
362362+ let _ = foo
363363+end;;
364364+[%%expect {|
365365+module Unused_field : sig end
366366+|}]
367367+368368+module Unused_field : sig end = struct
369369+ type t = { a : int; b : int; c : int }
370370+ let foo () = { a = 0; b = 0; c = 0 }
371371+ let bar x = x.a
372372+ let baz { c; _ } = c
373373+ let _ = foo, bar, baz
374374+end;;
375375+[%%expect {|
376376+module Unused_field : sig end
377377+|}]
378378+379379+module Unused_mutable_field : sig end = struct
380380+ type t = { a : int; mutable b : int }
381381+ let foo () = { a = 0; b = 0 }
382382+ let bar x = x.a, x.b
383383+ let _ = foo, bar
384384+end;;
385385+[%%expect {|
386386+module Unused_mutable_field : sig end
387387+|}]
388388+389389+module Unused_field_exported_private : sig
390390+ type t = private { a : int }
391391+end = struct
392392+ type t = { a : int }
393393+end;;
394394+[%%expect {|
395395+module Unused_field_exported_private : sig type t = private { a : int; } end
396396+|}]
397397+398398+module Unused_field_exported_private : sig
399399+ type t = private { a : int }
400400+end = struct
401401+ type t = { a : int }
402402+ let foo x = x.a
403403+ let _ = foo
404404+end;;
405405+[%%expect {|
406406+module Unused_field_exported_private : sig type t = private { a : int; } end
407407+|}]
408408+409409+module Unused_mutable_field_exported_private : sig
410410+ type t = private { a : int; mutable b : int }
411411+end = struct
412412+ type t = { a : int; mutable b : int }
413413+ let foo () = { a = 0; b = 0 }
414414+ let _ = foo
415415+end;;
416416+[%%expect {|
417417+module Unused_mutable_field_exported_private :
418418+ sig type t = private { a : int; mutable b : int; } end
419419+|}]