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: 7103 Reporter:@hhugo Assigned to:@garrigue Status: closed (set by @xavierleroy on 2017-02-16T14:18:06Z) Resolution: fixed Priority: normal Severity: minor Version: 4.02.3 Fixed in version: 4.03.0+dev / +beta1 Category: typing Monitored by:@hhugo@gasche
Bug description
the following type error
"Type a is not compatible with type 'a"
should contain the constraint on 'a.
"Type a is not compatible with type 'a = < .. >"
"Type a is not compatible with type 'a = [> `b]"
and eventually not talk about 'a is it's not needed.
Steps to reproduce
OCaml version 4.02.3
type 'a t
type a
let f : < .. > t -> unit = fun _ -> ();;
val f : < .. > t -> unit =
let g : [< `b] t -> unit = fun _ -> ();;
val g : [< `b ] t -> unit =
let h : [> `b] t -> unit = fun _ -> ();;
val h : [> `b ] t -> unit =
let _ = fun (x : a t) -> f x;;
Characters 27-28:
let _ = fun (x : a t) -> f x;;
^
Error: This expression has type a t but an expression was expected of type
(< .. > as 'a) t
Type a is not compatible with type 'a
let _ = fun (x : a t) -> g x;;
Characters 27-28:
let _ = fun (x : a t) -> g x;;
^
Error: This expression has type a t but an expression was expected of type
([< `b ] as 'a) t
Type a is not compatible with type 'a
let _ = fun (x : a t) -> h x;;
Characters 27-28:
let _ = fun (x : a t) -> h x;;
^
Error: This expression has type a t but an expression was expected of type
([> `b ] as 'a) t
Type a is not compatible with type 'a
The text was updated successfully, but these errors were encountered:
I'm not sure I understand the problem here.
'a is to be understood in the context of the type printed above, which indicates explicitly what 'a refers to.
It could be possible to print the type once more, but this can be heavy.
Original bug ID: 7103
Reporter: @hhugo
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:18:06Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @hhugo @gasche
Bug description
the following type error
"Type a is not compatible with type 'a"
should contain the constraint on 'a.
"Type a is not compatible with type 'a = < .. >"
"Type a is not compatible with type 'a = [> `b]"
and eventually not talk about 'a is it's not needed.
Steps to reproduce
OCaml version 4.02.3
type 'a t
type a
let f : < .. > t -> unit = fun _ -> ();;
val f : < .. > t -> unit =
let g : [< `b] t -> unit = fun _ -> ();;
val g : [< `b ] t -> unit =
let h : [> `b] t -> unit = fun _ -> ();;
val h : [> `b ] t -> unit =
let _ = fun (x : a t) -> f x;;
Characters 27-28:
let _ = fun (x : a t) -> f x;;
^
Error: This expression has type a t but an expression was expected of type
(< .. > as 'a) t
Type a is not compatible with type 'a
let _ = fun (x : a t) -> g x;;
Characters 27-28:
let _ = fun (x : a t) -> g x;;
^
Error: This expression has type a t but an expression was expected of type
([< `b ] as 'a) t
Type a is not compatible with type 'a
let _ = fun (x : a t) -> h x;;
Characters 27-28:
let _ = fun (x : a t) -> h x;;
^
Error: This expression has type a t but an expression was expected of type
([> `b ] as 'a) t
Type a is not compatible with type 'a
The text was updated successfully, but these errors were encountered: