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,255
    • Issues 5,255
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 563
    • Merge requests 563
  • 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
  • Issues
  • #17675
Closed
Open
Issue created Jan 13, 2020 by Richard Eisenberg@raeDeveloper0 of 3 checklist items completed0/3 checklist items

eqType fails on comparing FunTys

Suppose I have co :: IntRep ~ r and a :: TYPE IntRep. Consider t1 = a -> () and t2 = (a |> TYPE co) -> (). We have t1 `eqType` t2, but if we call splitTyConApp on t1 and t2, we'll get different arguments (the first arg in t1 will be IntRep while the first arg in t2 will be r). This violates property EQ of Note [Non-trivial definitional equality] in TyCoRep.

The fix is easy: in nonDetCmpTypeX, the FunTy case should recur into nonDetCmpTypeX for both argument and result. This does a kind check. Recurring into go skips the kind check.

Unfortunately, there are other places that also work with equality. This list includes at least

  • TcType.tc_eq_type
  • CoreMap
  • Pure unifier in Unify, which probably also needs to recur in kinds on a FunTy. Or maybe this works via decomposition into a TyConApp, so all is OK. But it needs to be checked.

I believe Simon has some preliminary work on a branch.

Edited Jan 13, 2020 by Richard Eisenberg
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking