Functional dependencies can get GHC to print "UnkSkol"
When I say
class C a b | a -> b where
foo :: a -> b
instance C Int Bool where
foo = (>0)
blah :: C Int Double => Int -> _a
blah = foo
I get
• Couldn't match type ‘Double’ with ‘Bool’
arising from a functional dependency between constraints:
‘C Int Bool’ arising from a use of ‘foo’ at Scratch.hs:51:8-10
‘C Int Double’ arising from UnkSkol at Scratch.hs:51:1-10
• In the expression: foo
In an equation for ‘blah’: blah = foo
There are actually two problems:
- If we replace
_a
withDouble
, GHC accepts the program. I'm not sure it should. But that's a larger problem than... - ... when it prints the error, it says
UnkSkol
. It probably shouldn't.
This ticket is about the second problem, because the first one require more fundep love than is usually on offer around here.
Erroring here is reasonable enoug
Trac metadata
Trac field | Value |
---|---|
Version | 8.4.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |