TcRnIllegalTermLevelUse: simpler error when possible
Tickets: #23982 (closed), #25877 (closed).
This MR contains two parts:
-
Store user-written module qualification in the
GhcRn
AST, so that when pretty-printingNames
we can show the user-written qualification when it is unambiguous. -
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