Skip to content

TcRnIllegalTermLevelUse: simpler error when possible

sheaf requested to merge sheaf/ghc:T23982 into master

Tickets: #23982 (closed), #25877 (closed).

This MR contains two parts:

  1. Store user-written module qualification in the GhcRn AST, so that when pretty-printing Names we can show the user-written qualification when it is unambiguous.

  2. Emit a simpler error message in the case of an illegal term-level use of a data constructor: we will try to report an out-of-scope error instead of a "Illegal term level use" error, as the latter might be a bit overwhelming for newcomers. We do this when we have a data constructor import suggestion for the user, in order to avoid saying "data constructor not in scope: Bool" which is not very helpful.

Edited by sheaf

Merge request reports

Loading