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,333
    • Issues 4,333
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 371
    • Merge Requests 371
  • 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
  • #1432

Closed
Open
Opened Jun 17, 2007 by Ian Lynagh <igloo@earth.li>@trac-igloo

Poor type error messages (refer to generated code rather than the higher level problem)

With this module:

module Foo where

data Foo a = Foo
data Bar a = Bar (Foo a)
    deriving Eq

the HEAD says:

q.hs:5:0:
    Non type-variable argument in the constraint: Eq (Foo a)
    (Use -fglasgow-exts to permit this)
    In the context: (Eq (Foo a))
    While checking the context of an instance declaration
    In the derived instance: (Eq (Foo a)) => Eq (Bar a)

which isn't really the error message that we want, as it's refering to the generated instance.

  1. 6 gives the much better:
q.hs:5:5:
    No instance for (Eq (Foo a))
      arising from the 'deriving' clause of a data type declaration
      at q.hs:5:5
    Possible fix: add an instance declaration for (Eq (Foo a))
    When deriving the instance for `Eq (Bar a)'

This example is from tcfail046; tcfail169 is similar and tcfail118 is also a related issue.

Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Assignee
Assign to
6.8.1
Milestone
6.8.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#1432