You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7471 Reporter: antron Status: closed (set by @mshinwell on 2017-03-10T08:25:48Z) Resolution: fixed Priority: normal Severity: minor Version: 4.04.0 Category: typing Duplicate of:#7451
Bug description
See code below.
Steps to reproduce
repro.ml:
type t = Wrap of unit
[@@ocaml.unboxed]
let () =
let wrapped = () in
let wrapper = Wrap wrapped in
assert (Obj.repr wrapped == Obj.repr wrapper);
let Wrap () = wrapper in
match wrapper with
| Wrap () -> ()
Compiling this with
ocamlfind opt -w +A -linkpkg repro.ml
results in the output:
File "repro.ml", line 10, characters 6-13:
Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type t.
File "repro.ml", line 12, characters 2-38:
Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type t.
If the [@@unboxed] attribute is removed from type t, no warnings are emitted. I expected no warnings with and without the attribute.
The text was updated successfully, but these errors were encountered:
Original bug ID: 7471
Reporter: antron
Status: closed (set by @mshinwell on 2017-03-10T08:25:48Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.04.0
Category: typing
Duplicate of: #7451
Bug description
See code below.
Steps to reproduce
repro.ml:
type t = Wrap of unit
[@@ocaml.unboxed]
let () =
let wrapped = () in
let wrapper = Wrap wrapped in
assert (Obj.repr wrapped == Obj.repr wrapper);
let Wrap () = wrapper in
match wrapper with
| Wrap () -> ()
Compiling this with
ocamlfind opt -w +A -linkpkg repro.ml
results in the output:
File "repro.ml", line 10, characters 6-13:
Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type t.
File "repro.ml", line 12, characters 2-38:
Warning 4: this pattern-matching is fragile.
It will remain exhaustive when constructors are added to type t.
If the [@@unboxed] attribute is removed from type t, no warnings are emitted. I expected no warnings with and without the attribute.
The text was updated successfully, but these errors were encountered: