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: 7091 Reporter:@Chris00 Assigned to:@garrigue Status: assigned (set by @alainfrisch on 2017-02-22T16:15:15Z) Resolution: open Priority: normal Severity: feature Platform: x86_64 OS: GNU/Linux OS Version: Debian testing Target version: undecided Category: typing Duplicate of:#7319 Monitored by: runhang @hcarty@Chris00
Bug description
# type 'a a = A : int a | B : float a | C : int a;;
# let f : type v. v a -> int = function A -> 1 | B -> 2 | C -> 1;;
val f : 'v a -> int = <fun>
works fine. However:
# let f : type v. v a -> int = function A | C -> 1 | B -> 2;;
Characters 38-39:
let f : type v. v a -> int = function A | C -> 1 | B -> 2;;
^
Error: This pattern matches values of type int a
but a pattern was expected which matches values of type v a
Type int is not compatible with type v
This is rather surprising and should be fixed if possible (at least the error which really points in the wrong direction).
The text was updated successfully, but these errors were encountered:
iirc, Jacques talked about this somewhere on Mantis already. The or-pattern here is wrong, but I agree there should be some fix, at least the error message, which is really not helpful.
Original bug ID: 7091
Reporter: @Chris00
Assigned to: @garrigue
Status: assigned (set by @alainfrisch on 2017-02-22T16:15:15Z)
Resolution: open
Priority: normal
Severity: feature
Platform: x86_64
OS: GNU/Linux
OS Version: Debian testing
Target version: undecided
Category: typing
Duplicate of: #7319
Monitored by: runhang @hcarty @Chris00
Bug description
works fine. However:
This is rather surprising and should be fixed if possible (at least the error which really points in the wrong direction).
The text was updated successfully, but these errors were encountered: