Overeager deferred type errors
With TypeInType
, the solver now works in terms of unlifted equality. The only place this matters is in deferred type errors, which now are more eager than they were before. For example:
{-# OPTIONS_GHC -fdefer-type-errors #-}
module Main where
main = do
putStrLn "Hi there."
putStrLn True
This used to print
Hi there.
Defer: Defer.hs:7:12: error:
...
Now it prints
Defer: Defer.hs:7:12: error:
...
No more Hi there.
.
Thinking about Core, this change should be expected. GHC puts all evidence bindings for main
at the top, and with unlifted equality in the solver, these bindings now contain case typeError ... of ...
, which forces the type error eagerly. Previously, there was a lazy binding for a lifted equality witness, unpacked only at the last moment by magic in the desugarer, thus the lazier warning.
Simon has proposed customizing the !FloatIn pass to deal with this scenario. I do believe this would work nicely, but I have not yet implemented it.
Trac metadata
Trac field | Value |
---|---|
Version | 7.11 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |