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
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.
The text was updated successfully, but these errors were encountered:
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.