Improve error message when the same type is imported from two different library versions
When a package indirectly depends on different versions of the same library, ghc reports cryptic error:
Couldn't match expected type `ByteString'
with actual type `bytestring-0.9.2.1:Data.ByteString.Internal.ByteString'
Error contains fully qualified type with package name and version only when the type is imported from different versions on the library, so looks like ghc knows what is wrong.
Is it possible to add something like the next:
Note: ByteString is imported from different package versions:
bytestring-0.9.2.1 and bytestring-0.10.0.1
It is inspired by a number of StackOverflow questions (e.g. http://stackoverflow.com/questions/12576817/couldnt-match-expected-type-with-actual-type-error-when-using-codec-bmp/12577025#12577025, http://stackoverflow.com/questions/18767086/bytestring-to-lazy-text-and-vice-versa/18769431?noredirect=1#comment27676563_18769431)
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |