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: 6872 Reporter:@gasche Assigned to:@garrigue Status: closed (set by @xavierleroy on 2016-12-07T10:49:20Z) Resolution: fixed Priority: normal Severity: minor Version: 4.02.1 Target version: 4.03.0+dev / +beta1 Fixed in version: 4.02.2+dev / +rc1 Category: typing Child of:#6871 Monitored by:@diml@hcarty
Bug description
When a potentially-ambiguous variant constructor has "exn" has one possible type, it always raise Warning 41, even if type-directed propagation successfully disambiguated it.
$ opam config exec --switch=4.02.1 -- ocaml -w A
OCaml version 4.02.1
type a = A;;
type a = A
exception A;;
exception A
raise A;;
Warning 41: A belongs to several types: exn a
The first one was selected. Please disambiguate if this is wrong.
Exception: A.
raise (A : exn);;
Warning 41: A belongs to several types: exn a
The first one was selected. Please disambiguate if this is wrong.
Exception: A.
let f (x : exn) = ();;
Warning 27: unused variable x.
val f : exn -> unit =
f A;;
Warning 41: A belongs to several types: exn a
The first one was selected. Please disambiguate if this is wrong.
: unit = ()
This is highly problematic in trunk because the Error constructor introduced in the ('a, 'b) result type in Pervasives makes user-defined Error exception-constructors ambiguous, which litters some user code with dozens of unjustified Warning 41 instances. This was raised by Romain Beauxis in #147 (comment)
and #6871.
The text was updated successfully, but these errors were encountered:
Original bug ID: 6872
Reporter: @gasche
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:49:20Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Child of: #6871
Monitored by: @diml @hcarty
Bug description
When a potentially-ambiguous variant constructor has "exn" has one possible type, it always raise Warning 41, even if type-directed propagation successfully disambiguated it.
$ opam config exec --switch=4.02.1 -- ocaml -w A
OCaml version 4.02.1
type a = A;;
type a = A
exception A;;
exception A
raise A;;
Warning 41: A belongs to several types: exn a
The first one was selected. Please disambiguate if this is wrong.
Exception: A.
raise (A : exn);;
Warning 41: A belongs to several types: exn a
The first one was selected. Please disambiguate if this is wrong.
Exception: A.
let f (x : exn) = ();;
Warning 27: unused variable x.
val f : exn -> unit =
f A;;
Warning 41: A belongs to several types: exn a
The first one was selected. Please disambiguate if this is wrong.
This is highly problematic in trunk because the Error constructor introduced in the ('a, 'b) result type in Pervasives makes user-defined Error exception-constructors ambiguous, which litters some user code with dozens of unjustified Warning 41 instances. This was raised by Romain Beauxis in
#147 (comment)
and #6871.
The text was updated successfully, but these errors were encountered: