Skip to content

Improve parser error messages (#18251)

Vladislav Zavialov requested to merge wip/t18251-error-messages into master

#18251 (comment 276814) points out that in GHC HEAD, the lexer/parser error messages are far from perfect in a few cases.

This merge request improves the error messages a bit, but also introduces a change in behavior. Now f @x = ... is parsed as a type application (abstraction) regardless of extensions. As-patterns must be written without surrounding whitespace, always. This is documented in the User's Guide.

Commit messages contain more detailed explanations of the changes. (They are independent so I do not intend to squash).

The new error messages are covered by test cases.

Edited by Vladislav Zavialov

Merge request reports