Out-of-scope variable leads to type error, not scope error
When I write the following:
{-# language TypeApplications #-}
module Bug where
huh = spam @Int
I expect to get the error:
• Variable not in scope: spam
• Perhaps you meant ‘span’ (imported from Prelude)
But instead, I get the error:
• Cannot apply expression of type ‘t0’
to a visible type argument ‘Int’
• In the expression: spam @Int
In an equation for ‘huh’: huh = spam @Int
While it is //technically// true that I cannot apply an out-of-scope identifier to a visible type argument, this is probably the less useful error to receive.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler (Type checker) |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | goldfire |
| Operating system | |
| Architecture |
Edited by Richard Eisenberg