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: 7884 Reporter:@yallop Assigned to:@yallop Status: resolved (set by @yallop on 2018-12-21T19:30:48Z) Resolution: not a bug Priority: normal Severity: minor Category: language features Monitored by:@nojb
Bug description
This is allowed in a signature:
module rec X : T
and Y : T with type t = int
and this is allowed, too:
module rec X : T with type t = int [@@foo]
and Y : T
but this is currently rejected as a syntax error:
module rec X : T with type t = int
and Y : T
The text was updated successfully, but these errors were encountered:
module rec X : T with type t = int
and type t = int
that is resolved in favour of shifting the and.
It can be avoided using parentheses:
module rec X : (T with type t = int)
and Y : T
I think that avoiding the conflict isn't really possible in an LR(1) grammar because you'd need to know whether to shift or reduce the and without looking at the Y. Maybe you could extensively re-engineer the grammar so that the conflict was avoided, but I suspect its quite difficult to do so.
Note that, in the specification case, the module-types must be parenthesized if they use the with mod-constraint construct.
It could be made a bit more precise, I suppose, by mentioning that the parentheses aren't needed on the last member in the group, but it hardly seems worth it.
Original bug ID: 7884
Reporter: @yallop
Assigned to: @yallop
Status: resolved (set by @yallop on 2018-12-21T19:30:48Z)
Resolution: not a bug
Priority: normal
Severity: minor
Category: language features
Monitored by: @nojb
Bug description
This is allowed in a signature:
module rec X : T
and Y : T with type t = int
and this is allowed, too:
module rec X : T with type t = int [@@foo]
and Y : T
but this is currently rejected as a syntax error:
module rec X : T with type t = int
and Y : T
The text was updated successfully, but these errors were encountered: