Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,264
    • Issues 5,264
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5736
Closed
Open
Issue created Dec 31, 2011 by magnus@trac-magnus

Possible regression with functional dependencies

The following program typechecks in GHC-7.0.4, but not in 6.12.3, 7.2.2 or 7.5.20111229:

{-# LANGUAGE FunctionalDependencies, MultiParamTypeClasses, 
  FlexibleInstances, UndecidableInstances, TypeFamilies #-}

class C a b | a -> b where
  c :: a -> b

instance C b b where
  c = undefined

instance C Bool b where
  c = undefined

m :: Int
m = c True
  1. 5.20111229 says
    Couldn't match type `Bool' with `Int'
    When using functional dependencies to combine
      C b b,
        arising from the dependency `a -> b'
        in the instance declaration at Test.hs:7:10
      C Bool Int, arising from a use of `c' at Test.hs:14:5
    In the expression: c True
    In an equation for `m': m = c True

Was I just lucky that this worked in 7.0.4, or is it a true regression?

Trac metadata
Trac field Value
Version 7.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking