"No constructor has all these fields" message can be improved
When a record update syntax contains fields from multiple constructors, you get an error message like this:
module Foo where
data A = A {a0, a1 :: Int}
data B = B {b0, b1 :: Int}
f x = x { a0 = 3, a1 = 2, b0 = 4, b1 = 5 }
datacon.hs:6:7:
No constructor has all these fields: `a0', `a1', `b0', `b1'
In the expression: x {a0 = 3, a1 = 2, b0 = 4, b1 = 5}
In an equation for `f': f x = x {a0 = 3, a1 = 2, b0 = 4, b1 = 5}
However, this message becomes rather unhelpful when you are updating many (say 100) fields at once, because it doesn't say which field is causing the problem. I think it would be better if it only listed two conflicting field names like:
No constructor has these two fields: `a0', `b0'
Trac metadata
Trac field | Value |
---|---|
Version | 7.7 |
Type | FeatureRequest |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |