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,388
    • Issues 4,388
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 374
    • Merge Requests 374
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #13788

Closed
Open
Opened Jun 05, 2017 by br1@internet.com.uy@trac-br1

TypeInType fails to compile old code

{-#  LANGUAGE TypeInType              #-}

module PP where

newtype Field l v   =   Field { value :: v }

label  ::  Field l v -> l
label  =   undefined

class HEq x
hEq :: HEq x => x -> Int
hEq = undefined

class HListGet r where
    hListGet :: r -> Int
instance
    HEq l => HListGet (Field l v) where
    hListGet f = hEq (label f)

fails with

mini.hs:18:29: error:
    • Couldn't match type ‘k’ with ‘*’
      ‘k’ is a rigid type variable bound by
        the instance declaration at mini.hs:17:5-33
      Expected type: Field * l v
        Actual type: Field k l v
    • In the first argument of ‘label’, namely ‘f’
      In the first argument of ‘hEq’, namely ‘(label f)’
      In the expression: hEq (label f)
    • Relevant bindings include
        f :: Field k l v (bound at mini.hs:18:14)
        hListGet :: Field k l v -> Int (bound at mini.hs:18:5)
   |
18 |     hListGet f = hEq (label f)
   |
Trac metadata
Trac field Value
Version 8.2.1-rc2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#13788