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

Strange syntax error message around illegal packaged module signature constraints #7097

Closed
vicuna opened this issue Dec 17, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@vicuna
Copy link

commented Dec 17, 2015

Original bug ID: 7097
Reporter: furuse
Assigned to: @alainfrisch
Status: closed (set by @xavierleroy on 2017-09-24T15:31:42Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: ~DO NOT USE (was: OCaml general)
Child of: #5068
Monitored by: @hcarty

Bug description

The following illegal code has a typical mistake of having parametered type in a constraint of a packaged module type:

let insert_twice (type u) (module M : S with type 'a t = 'a u) a at =
M.insert a (M.insert a at)

The error message of the parser is very cryptic:

Error: Syntax error: module-expr expected.

The syntaxes of the normal signature and packed signatures are very similar but different, therefore we should have better message to inform that you cannot have parameters there.

@vicuna

This comment has been minimized.

Copy link
Author

commented Dec 17, 2015

Comment author: @gasche

Thanks for the report. We are planning to work on syntax error messages (not in the 4.03 timeframe though, but rather in 2016), and collecting concrete examples of programs where the syntax error message is unhelpful (because it is unclear, or because it seems to point to the wrong location or doesn't help finding the cause) is very useful as it will serve as a testbed for our new approach.

@vicuna

This comment has been minimized.

Copy link
Author

commented Jan 5, 2016

Comment author: @alainfrisch

Fixed by commit e1e0382 on trunk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.