Ticket #2618 (closed bug: invalid)
Order is relevant when matching signature contexts of a mutually recursive group
| Reported by: | guest | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.10.1 |
| Component: | Compiler (Type checker) | Version: | 6.8.3 |
| Keywords: | Cc: | sanzhiyan@… | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | Difficulty: | Unknown | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
The Following code
f :: (Show a, Eq a) => a -> String f x = show x `const` g x g :: (Eq a,Show a) => a -> Bool g x = x==x `const` f x
gives this error:
Couldn't match expected type `Eq a' against inferred type `Show a1'
When matching the contexts of the signatures for
f :: forall a. (Show a, Eq a) => a -> String
g :: forall a. (Eq a, Show a) => a -> Bool
The signature contexts in a mutually recursive group should all be identical
When generalising the type(s) for f, g
Failed, modules loaded: none.
but it compiles fine if i swap Show and Eq in the context of either f or g. The order of typeclass constraints usually doesn't matter so it's very surprising that it does here.
Change History
Note: See
TracTickets for help on using
tickets.
