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,399
    • Issues 5,399
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 592
    • Merge requests 592
  • 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
  • #11762
Closed
Open
Issue created Mar 28, 2016 by Serge Kosyrev@_deepfireReporter

GHC 8 superclass chain constraint regression

It seems that GHC 8 regresses with regard to GHC 7.10, when it tries to satisfy the constraints, implied by instance context.

The following does not build on GHC 8.0.1 RC2, but does on 7.10.3:

{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances #-}
--{-# LANGUAGE UndecidableSuperClasses #-} -- this doesn't matter
{-# LANGUAGE UnicodeSyntax #-}

module Foo where

class Super a
class Super a ⇒ Left a
class Super a ⇒ Right a
instance (Left a) ⇒ Right a

the error being:

• Could not deduce (Super a) arising from the superclasses of an instance declaration from the context: Left a bound by the instance declaration at repro.hs:9:10-27 Possible fix: add (Super a) to the context of the instance declaration • In the instance declaration for ‘Right a’

It also /roughly/ seems that https://phabricator.haskell.org/D1594 could possibly be related.

Trac metadata
Trac field Value
Version 8.0.1-rc2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking