[GHC] #8592: FunDep error message regression
GHC
ghc-devs at haskell.org
Tue Dec 3 13:27:34 UTC 2013
#8592: FunDep error message regression
-------------------------------------------+-------------------------------
Reporter: nomeata | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.7
Keywords: | Operating System:
Architecture: Unknown/Multiple | Unknown/Multiple
Difficulty: Unknown | Type of failure:
Blocked By: | None/Unknown
Related Tickets: | Test Case:
| Blocking:
-------------------------------------------+-------------------------------
This code (provided by Cale Gibbard)
{{{
#!haskell
{-# LANGUAGE FunctionalDependencies, FlexibleContexts #-}
class C a b | a -> b where
foo :: a -> b
instance C Integer Integer where
foo = id
f :: Integer -> String
f = foo
}}}
produced this error message in GHC 7.6:
{{{
fundep.hs:10:5:
Couldn't match type `Integer' with `String'
When using functional dependencies to combine
C Integer Integer,
arising from the dependency `a -> b'
in the instance declaration at fundep.hs:6:10
C Integer String, arising from a use of `foo' at fundep.hs:10:5-7
In the expression: foo
In an equation for `f': f = foo
}}}
but this one with GHC HEAD
{{{
FunDepError.hs:11:5:
No instance for (C Integer String) arising from a use of ‛foo’
In the expression: foo
In an equation for ‛f’: f = foo
}}}
which seems to be a regression.
It may be that either message is fine (it seems to be in this case), In
that case, this bug is about the test suite not having a test case for
where we do want to see the `When using functional dependencies to
combine` message.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8592>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list