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 359
    • Merge Requests 359
  • 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
  • #1430

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

getC: Type signature needed when existential types are used but not in the type signature

This module:

{-# OPTIONS -fglasgow-exts #-}
module Q where

import Data.Typeable

data ExTypeable = forall a. Typeable a => ExTypeable a

-- unExTypeable :: Typeable h => ExTypeable -> Maybe h
unExTypeable (ExTypeable a) = cast a

with the type signature commented out gives this in the HEAD:

q.hs:10:30:
    Could not deduce (Typeable b) from the context (Typeable a)
      arising from a use of `cast' at q.hs:10:30-35
    Possible fix:
      add (Typeable b) to the context of the constructor `ExTypeable'
    In the expression: cast a
    In the definition of `unExTypeable':
        unExTypeable (ExTypeable a) = cast a

It works in 6.6.

It's part of the getC test.

Trac metadata
Trac field Value
Version 6.6.1
Type Bug
TypeOfFailure OtherFailure
Priority high
Resolution Unresolved
Component Compiler (Type checker)
Test case getC
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#1430