Skip to content

GHCi should not defer typed holes

In the function tcUserStmt in compiler/typecheck/TcRnDriver.hs, before going over the different ways ('plans') to lift an expression typed at the prompt into the GHCi monad, Opt_DeferTypeErrors is disabled. Here is the accompanying comment:

         -- Ensure that type errors don't get deferred when type checking the
         -- naked expression. Deferring type errors here is unhelpful because the
         -- expression gets evaluated right away anyway. It also would potentially
         -- emit redundant type-error warnings, one from each plan.
         ; plan <- unsetGOptM Opt_DeferTypeErrors $

Since Opt_DeferTypeErrors implies Opt_DeferTypedHoles, Opt_DeferTypedHoles should be disabled here as well. This will improve the error message for T10248.

Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information