functions on records with overloaded names can be given a too-specific type
Here's a reduced test-case showing a discrepancy between the symmetric functions foo and bar; the inferred type for foo is too specific.
data T a = A{ m1 :: a } | B{ m1, m2 :: a } | C{ m2 :: a }
-- bar :: (t -> a) -> T t -> T a
bar f x@(A m) = x{m1 = f m}
-- foo :: (a -> a) -> T a -> T a
foo f x@(C m) = x{m2 = f m}
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.10.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |