Join GitHub today
Wish: implicit identity coercion in pattern-matching #7960
Original bug ID: 1485
Full_Name: Hugo Herbelin
I fell on the following curiosity where f : int foo -> bool -> (int * bool)
type 'a foo = A of 'a | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8
let f (x:int foo) (y:bool) = match (x,y) with
let g (x:int foo) (y:bool) = match (x,y) with
Comment author: administrator
A story of half-empty or half-full bottle.
Another point of view is that you can be glad that f compiles....
Let us forget about typing constaints first.
| (B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 as t), _ -> t
By contrast, when you write
Ok you tell me : but I there are type constraints....
My first answer would be : do not use them ! They have no clear
My second answer would be that some people in the team are working
Merci d'avoir soulevé ce lièvre....