Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
    • Insights
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 3,607
    • Issues 3,607
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 199
    • Merge Requests 199
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Security & Compliance
    • Security & Compliance
    • Dependency List
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #6001

Closed
Open
Opened Apr 12, 2012 by Gabor Greif@ggreif
  • Report abuse
  • New issue
Report abuse New issue

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

Related issues

  • Discussion
  • Designs
Assignee
Assign to
7.6.1
Milestone
7.6.1
Assign milestone
Time tracking
None
Due date
None
4
Labels
bug error messages P::normal Trac import
Assign labels
  • View project labels
Reference: ghc/ghc#6001