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: 1884 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
This expression has type [< B of int & bool ] but is here used with type [< B of bool & int ]
This is now fixed in CVS. (Harder than you imagine)
The new message is:
This expression has type [< B of int & bool ] but is here used with type [ B of bool ]
I hesitated between this and
This expression has type [< B of int ] but is here used with type [< B of bool ]
but the latter may be harder to understand in some cases (if you don't
remember that variants with only one case cannot use conjunctive
types). Actually you can even imagine situations where it would still
give you the original message.
Original bug ID: 1884
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Sejourne Kevin
Version: 3.06 & 3.07
OS: (win 3.07)(debian 3.06)
Submission from: aste-genev-bois-104-1-1-143.w217-128.abo.wanadoo.fr (217.128.225.143)
Pour reproduire ce message d'erreur etrange il faut saisir c'est ligne dans un
interpreteur interractif.
let f = function
A _ -> 1 |
B x -> x;;val f : [<
A of 'a |
B of int ] -> int =let g = function
C _ -> 2 |
B x ->if x then 3 else 4;;val g : [<
B of bool |
C of 'a ] -> int =let h x = (f x)+(g x);;
Characters 19-20:
let h x = (f x)+(g x);;
^
This expression has type [<
B of int & bool ] but is here used with type [<
B of bool & int ]Evidemment ce code ne devrais pas compiler, mais l'explication donné par
le compilateur est très curieuse.
The text was updated successfully, but these errors were encountered: