compiler: refactor error reporting code for ExplicitLevelImports

Changes contained in this patch

Surprisingly simple refactoring MR that passes more information into the error reporting code for explicit level imports. This allows for more precise error reporting in the presence of qualification and resolves an issue with importing at the wrong level depending on qualification.

MR Checklist

  • This MR solves the problem described in the following issue: #26616 (closed) and #27385 (closed)
  • A changelog entry was added in changelog.d/ for user-facing changes (see changelog guide). If this MR does not need a changelog entry, the no-changelog label was applied.
  • This MR does not make any significant changes to base, or it has an accompanying CLC proposal.
  • If this MR has the potential to break user programs, the user-facing label was applied to test against head.hackage.
  • All commits are either individually buildable or squashed.
  • Commit messages describe what they do, referring to tickets using #NNNNN syntax.
  • Source comments describing the change were added. For larger changes notes and cross-references from the relevant places were added (as applicable).
  • Testcases to the testsuite were added (as applicable).
  • The users guide was updated (as applicable).
Edited by Magnus

Merge request reports

Loading