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
That looks like a programming mistake to me, because your (int -> int) annotation is wrong, you should write (int t -> int) or drop it altogether as the compiler can infer it.
Original bug ID: 6849
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2016-12-07T10:49:12Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.1
Target version: 4.02.2+dev / +rc1
Fixed in version: 4.02.2+dev / +rc1
Category: typing
Monitored by: @hcarty
Bug description
The following code:
type 'a t = Foo : int t
let f : int -> int = function
Foo -> 5;;
produces the following error:
Error: This pattern matches values of type int
but a pattern was expected which matches values of type 'a t
The types should of course be the other way around.
The text was updated successfully, but these errors were encountered: