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,321
    • Issues 4,321
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 366
    • Merge Requests 366
  • 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
  • #11105

Closed
Open
Opened Nov 17, 2015 by Simon Peyton Jones@simonpjDeveloper

Put the generic-default type in the Class

This is an internal GHC refactoring ticket. Consider

{-# LANGUAGE DefaultSignatures #-}
class C a where
  op :: a -> a -> Bool
  default op :: Ord a => a -> a -> Bool
  op x y = x < y

The Class object for C has a ClassOpItem that specifies

  • the name op
  • the type of the method a -> a -> Bool
  • that op has a generic-default signature

BUT it does not contain the actual signature Ord a => a -> a -> Bool. That's really wrong; it is certainly part of the definition of the class, and we should print it out when we say :info C in ghci.

Instead this type is kept solely in the top-level generic-default Id binding. But that means that default-method Ids and generic-default method Ids are treated differently; see gen_dm_ids in tcTyClDecl1 in TcTyClsDecls, and mkDefaultMethodIds in TcTyDecls.

We should treat them uniformly. I know how but have too much in flight to do it immediately.

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.0.1
Milestone
8.0.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#11105