Treat an out-of-scope variable like a typed hole
If we have
f x = x + y
GHC currently reports Not in scope: y
, and halts. It would be cool to treat y
as a typed hole, so that
- The out-of-scope message would give its type
- Using
-fdefer-type-errors
we could defer the error to runtime.
This was suggested in #5910 comment 19, and this Haskell Cafe thread
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |