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,401
    • Issues 5,401
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 591
    • Merge requests 591
  • 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
  • #20582
Closed
Open
Issue created Oct 29, 2021 by Richard Eisenberg@raeDeveloper

Regression around quantified constraints and superclasses

GHC 9.2 (and HEAD) reject the following, despite the fact that GHC 8.10.5 accepts:

{-# LANGUAGE QuantifiedConstraints #-}

module Bug2 where

f :: (forall a. Ord (m a), forall a. Semigroup a => Eq (m a)) => m Int
f = f

The problem is that, in the ambiguity check, GHC has [W] Eq (m a). But it has two ways to solve an [W] Eq (m a) constraint: either from the quantified constraint for Eq (m a) or from the superclass of the quantified constraint for Ord (m a). And so GHC, when presented with a fork in the road, crashes.

The Semigroup a => constraint is necessary to trigger the problem.

I don't know how GHC 8.10.5 accepted this program, and I have not yet explored further.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking