Skip to content

GitLab

  • Menu
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 4,869
    • Issues 4,869
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 453
    • Merge requests 453
  • 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 Compiler
  • GHCGHC
  • Issues
  • #17959
Closed
Open
Created Mar 25, 2020 by Fabio Mogavero@fabiomogavero

Cannot use Type Synonym with QuantifiedConstraints in GHC 8.8: "Illegal type synonym family application"

Consider the following simple snippet with three classes, one of which has an associated type synonym:

{-# LANGUAGE FlexibleContexts, QuantifiedConstraints, TypeFamilies #-}
class A c
class B c
class (A (D c) => B (D c)) => C c where
  type D c

GHC 8.6.5 compiles it like a charm, but both GHC 8.8.2 and 8.8.3 fail to compile with the following message:

• Illegal type synonym family application ‘D c’ in instance:
    B (D c)
• In the quantified constraint ‘A (D c) => B (D c)’
  In the context: A (D c) => B (D c)
  While checking the super-classes of class ‘C’
  In the class declaration for ‘C’

Now, I am not sure if this is really a bug or, instead, a correction to the compiler, but I do not actually see why the snippet should fail to compile.

/label needs triage /label ~bug /label TypeFamilies /label QuantifiedConstraints

Edited Mar 25, 2020 by Fabio Mogavero
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking