Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,268
    • Issues 4,268
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 408
    • Merge Requests 408
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #8978

Closed
Open
Opened Apr 09, 2014 by joelteon@trac-joelteon

Type synonyms in class associated types behave strangely

{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE TypeFamilies #-}

type Syn a = Associated a

class Eq (Associated a) => Foo a where
    type Associated a :: *
    foo :: a -> Syn a -> Bool

instance Foo () where
    type Associated () = Int
    foo _ x = x == x

In 7.6.3 and 7.8.1-rc2, this file compiles. In 7.8.1 release, GHC produces this error:

    No instance for (Eq (Syn ())) arising from a use of ‘==’
    In the expression: x == x
    In an equation for ‘foo’: foo _ x = x == x
    In the instance declaration for ‘Foo ()’

even though there is an Eq instance for Associated (), and Syn is just a type synonym.

Trac metadata
Trac field Value
Version 7.8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 09, 2019 by joelteon
Assignee
Assign to
7.8.2
Milestone
7.8.2
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#8978