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: 5155 Reporter: yziquel Assigned to:@garrigue Status: resolved (set by @damiendoligez on 2012-09-19T12:13:05Z) Resolution: suspended Priority: normal Severity: minor Version: 3.12.0 Target version: 4.01.0+dev Category: ~DO NOT USE (was: OCaml general)
Bug description
Here's a type declaration that is accepted. However the type information that is returned isn't accepted by the toplevel.
yziquel@seldon:~$ ocaml
Objective Caml version 3.12.0
type 'a t = private ( < .. > as 'a);;
type 'a t = private < .. > constraint 'a = 'a t
type 'a t = private < .. > constraint 'a = 'a t;;
Error: The type constraints are not consistent.
Type 'a is not compatible with type 'a t
The text was updated successfully, but these errors were encountered:
I admit the situation is confusing.
However, I have no easy fix at this point.
Parsing of type expressions is so complicated that fixing this is bound to break something else...
Two remarks:
I'm afraid this definition is not what you intended. It defines a private row type, whose parameter is constrained to be itself. This is not a private abbreviation, and actually this type ends up not being usable.
If you want a private abbreviation, the declaration should be
type 'a t = 'a constraint 'a = < .. >
This version gets printed correctly.
is indeed what I want. Couldn't it be possible to make the toplevel print this type declaration instead of the following?
type 'a t = < .. > constraint 'a t = 'a
It seems to me that the main issue is the fact that 'a is implicit in < .. >. Wouldn't it be better to have a way to make it explicit? Like < .. as 'a >?
Original bug ID: 5155
Reporter: yziquel
Assigned to: @garrigue
Status: resolved (set by @damiendoligez on 2012-09-19T12:13:05Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 3.12.0
Target version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Bug description
Here's a type declaration that is accepted. However the type information that is returned isn't accepted by the toplevel.
yziquel@seldon:~$ ocaml
Objective Caml version 3.12.0
type 'a t = private ( < .. > as 'a);;
type 'a t = private < .. > constraint 'a = 'a t
type 'a t = private < .. > constraint 'a = 'a t;;
Error: The type constraints are not consistent.
Type 'a is not compatible with type 'a t
The text was updated successfully, but these errors were encountered: