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

I cannot parse "let e : type a. int = 3;;". #6503

Closed
vicuna opened this issue Jul 30, 2014 · 1 comment
Closed

I cannot parse "let e : type a. int = 3;;". #6503

vicuna opened this issue Jul 30, 2014 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jul 30, 2014

Original bug ID: 6503
Reporter: norm
Assigned to: @yallop
Status: closed (set by @xavierleroy on 2016-12-07T10:34:22Z)
Resolution: not a bug
Priority: normal
Severity: text
Platform: Irrelevant
Version: 4.01.0
Category: documentation

Bug description

The OCaml version 4.01.0 top level accepts the following degenerate but evidently meaningful statement:
let e : type a. int = 3;;
I cannot parse this expression according to the official syntax at:
http://caml.inria.fr/pub/docs/manual-ocaml/language.html
I would guess that an additional alternative to let-binding is needed.
Probably another syntactic category is needed to produce text such as "type a b.".

Steps to reproduce

This involves mainly reading the page at:
http://caml.inria.fr/pub/docs/manual-ocaml/expr.html

@vicuna
Copy link
Author

vicuna commented Jul 30, 2014

Comment author: @yallop

This syntax is described in the extensions section:

let-binding	::=	...  
   value-name : type  { typeconstr-name }+ .  typexpr =  expr

http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#sec229

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

1 participant