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,247
    • Issues 5,247
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 561
    • Merge requests 561
  • 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
  • #10087
Closed
Open
Issue created Feb 14, 2015 by andreas.abel@trac-andreas.abel

DefaultSignatures: error message mentions internal name

{-# LANGUAGE DefaultSignatures #-}

class C a where
  reflexive :: a -> Bool
  default reflexive :: Eq a => a -> Bool
  reflexive x = x == x

data D

instance C D where

-- /home/abel/play/haskell/bugs/DefaultSig.hs:10:10:
--     No instance for (Eq D) arising from a use of ‘Main.$gdmreflexive’
--     In the expression: Main.$gdmreflexive
--     In an equation for ‘reflexive’: reflexive = Main.$gdmreflexive
--     In the instance declaration for ‘C D’

Error looks odd: The user has not written $gdmreflexive in his code.

TODO: Better error message.

Maybe this should just trigger a warning that method reflexive is undefined for instance D of C. Like when I remove the default method.

/home/abel/play/haskell/bugs/DefaultSig.hs:10:10: Warning:
    No explicit implementation for
      ‘reflexive’
    In the instance declaration for ‘C D’

It seems the semantics of a default signature is that each instance *must* implement this method.

Trac metadata
Trac field Value
Version 7.8.4
Type FeatureRequest
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