Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,357
    • Issues 5,357
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 566
    • Merge requests 566
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Merge requests
  • !5872

Add PsHeaderMessage diagnostic (fixes #19923)

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Alfredo Di Napoli requested to merge wip/adinapoli-issue-19923 into master Jun 01, 2021
  • Overview 7
  • Commits 1
  • Pipelines 4
  • Changes 14

This commit replaces the PsUnknownMessage diagnostics over at GHC.Parser.Header with a new PsHeaderMessage type (part of the more general PsMessage), so that we can throw parser header's errors which can be correctly caught by GHC.Driver.Pipeline.preprocess and rewrapped (correctly) as Driver messages (using the DriverPsHeaderMessage).

This gets rid of the nasty compiler crash as part of #19923 (closed).

In order to expedite the fix, I used an UnknownHint instead of a proper type constructor for the hint we emit as part of PsErrUnsupportedExt. I have done that mostly because it would be nice to do this properly in a different patch: currently supportedLanguagesAndExtensions gives us back a [String], but it would be nice if it could gives us back something more structured. However, from a cursory look, that doesn't look like a quick thing to do and might require some refactoring and/or some upfront thinking, which I didn't want to make as part of this hotfix.

I have also added 3 new tests to catch this regression in the future.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: wip/adinapoli-issue-19923