Skip to content
Snippets Groups Projects

Synchronize ClsInst.doTyConApp with TcTypeable validity checks (#15862)

Closed Ryan Scott requested to merge RyanGlScott/ghc:wip/T15862 into master

Issue #15862 (closed) demonstrated examples of type constructors on which TcTypeable.tyConIsTypeable would return False, but the Typeable constraint solver in ClsInst (in particular, doTyConApp) would try to generate Typeable evidence for anyway, resulting in disaster. This incongruity was caused by the fact that doTyConApp was using a weaker validity check than tyConIsTypeable to determine if a type constructor warrants Typeable evidence or not. The solution, perhaps unsurprisingly, is to use tyConIsTypeable in doTyConApp instead.

To avoid import cycles between ClsInst and TcTypeable, I factored out tyConIsTypeable into its own module, TcTypeableValidity.

Fixes #15862 (closed).

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Ryan Scott resolved all discussions

    resolved all discussions

  • Simon Peyton Jones
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading