Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

object type ad type equalities in .mli #6155

Closed
vicuna opened this issue Sep 4, 2013 · 1 comment
Closed

object type ad type equalities in .mli #6155

vicuna opened this issue Sep 4, 2013 · 1 comment
Assignees

Comments

@vicuna
Copy link

vicuna commented Sep 4, 2013

Original bug ID: 6155
Reporter: @Drup
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2015-12-11T18:24:03Z)
Resolution: not a bug
Priority: normal
Severity: minor
Version: 4.01.0+beta/+rc
Category: typing

Bug description

The following syntax is not accepted in .mli files :

type t1 = t2 = < a : string >

It's accepted for anything else than an object type.

This seems to be already the case in 4.00.1.

@vicuna
Copy link
Author

vicuna commented Sep 4, 2013

Comment author: @gasche

This feature is documented in the manual ( http://caml.inria.fr/pub/docs/manual-ocaml/manual016.html ) as the combination of both a "type equation", adding an equality with an already-defined type expression, and a "type definition", introducing a new datatype (or generative type, if you wish), that is a sum type or a record, or re-exporting an existing datatype, for the purpose of introducing the datatype constructors/fields in the current scope as well.

Your example fails just as well with other already-defined type expressions, such as (int) or [ A | B ]. It wouldn't be much useful as (int), `A or #foo are already in scope anyway. I don't think any change is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants