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,263
    • Issues 4,263
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 419
    • Merge Requests 419
  • 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
  • #6001

Closed
Open
Opened Apr 12, 2012 by Gabor Greif@ggreif💬Developer

Wrong diagnostics for instance signature mismatch

Consider:


# LANGUAGE InstanceSigs, DataKinds, KindSignatures, GADTs #

data DayKind = Work | Rest

data Day :: DayKind -> * where

Mon :: Day Work Sat :: Day Rest

instance Num (Day c) where

fromInteger :: Int -> Day p fromInteger 1 = Mon fromInteger 6 = Sat


I get

$ ~/bin/ghci NumGADT.hs GHCi, version 7.5.20120410: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Main ( NumGADT.hs, interpreted )

NumGADT.hs:10:18:

Method signature does not match class; it should be

fromInteger forall (p :: DayKind). Int -\> Day p
In the instance declaration for \`Num (Day c)'

Failed, modules loaded: none. Prelude>

It appears to me that instead of telling me the expected signature GHCi simply echoes what I have provided. This is not really useful ;-)

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