Skip to content

Error message: visible type application of constructor/variable that is not in scope

If I use an identifier not in scope:

$ ghci -ignore-dot-ghci
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
Prelude> p

<interactive>:1:1: error: Variable not in scope: p
Prelude> P

<interactive>:2:1: error: Data constructor not in scope: P

Using visible type application:

$ ghci -ignore-dot-ghci -XTypeApplications
GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
Prelude> p @Int

<interactive>:1:1: error:
    • Cannot apply expression of type ‘t0’
      to a visible type argument ‘Int’
    • In the expression: p @Int
      In an equation for ‘it’: it = p @Int
Prelude> P @Int

<interactive>:2:1: error:
    • Cannot apply expression of type ‘t0’
      to a visible type argument ‘Int’
    • In the expression: P @Int
      In an equation for ‘it’: it = P @Int

I would prefer these error messages to be the same as the first two: thoughts?

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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