Strange syntax error message around illegal packaged module signature constraints #7097
Original bug ID: 7097
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 =
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.
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.