Improve error message when the same type is imported from two different library versions
|Reported by:||Yuras||Owned by:|
|Type of failure:||None/Unknown||Test Case:||typecheck/should_fail/tcfail182|
|Related Tickets:||Differential Revisions:|
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)
Change History (6)
comment:3 Changed 19 months ago by Simon Peyton Jones <simonpj@…>
comment:5 Changed 19 months ago by simonpj
- Resolution set to fixed
- Status changed from new to closed
- Test Case set to typecheck/should_fail/tcfail182