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
let f e =
match e with
| Error -> "foo"
| _ -> "bla"
Compile:
% ocamlopt -w +41 -c bla.ml
File "bla.ml", line 5, characters 7-12:
Warning 41: Error belongs to several types: exn result
The first one was selected. Please disambiguate if this is wrong.
Defining Error exceptions or really anything Error seems quite usual so it would seem natural if Pervasives did not use Error itself..
The text was updated successfully, but these errors were encountered:
Original bug ID: 6871
Reporter: toots
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:49:28Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.03.0+dev / +beta1
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: standard library
Parent of: #6872
Bug description
When testing 4.03, I ran into the following warning in a LOT of my files:
Warning 41: Error belongs to several types: exn result
The first one was selected. Please disambiguate if this is wrong.
This is due to the following type, defined in Pervasives:
type ('a,'b) result = Ok of 'a | Error of 'b
Minimal reproduction steps:
bla.ml:
exception Error
let f e =
match e with
| Error -> "foo"
| _ -> "bla"
Compile:
% ocamlopt -w +41 -c bla.ml
File "bla.ml", line 5, characters 7-12:
Warning 41: Error belongs to several types: exn result
The first one was selected. Please disambiguate if this is wrong.
Defining Error exceptions or really anything Error seems quite usual so it would seem natural if Pervasives did not use Error itself..
The text was updated successfully, but these errors were encountered: