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
Now we get warning 56 ("this match case is unreachable"). Is this considered ok (or should warning 11 be raised) ? I did not follow the discussion about "_ -> ." clauses, but I don't see offhand why this should be a different warning number.
This has to be a different warning, because if a case is only unreachable (rather than unused), you cannot just remove it, but have to replace it by a refutation case.
Note that 56 is a subcase of 11: you only get warning 56 if both 11 and 56 are turned on.
Original bug ID: 6220
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @garrigue on 2015-12-04T00:46:13Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.01.0
Target version: 4.03.0+dev / +beta1
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Child of: #5998 #6437
Monitored by: @gasche @hcarty
Bug description
It seems that warning 11 ("this match case is unused") does not take account of the type information of GADTs.
For example:
type 'a t = I : int t | F : float t;;
type 'a t = I : int t | F : float t
let f : int t -> int = function
let f : int t -> int = function
I would have expected the second declaration of
f
to raise warning 11, but it does not.The text was updated successfully, but these errors were encountered: