static: check for identifiers should only consider term level variables
Consider
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StaticPointers #-}
module Main where
import Data.Proxy
import GHC.StaticPtr
foo :: forall a. StaticPtr (Proxy a)
foo = static (Proxy :: Proxy a)
main :: IO ()
main = putStrLn "Hi"
This yields
Only identifiers of top-level bindings can appear in the body of the static form:
static (Proxy :: Proxy a)
but the following identifiers were found instead:
a
but a is a type-level variable and therefore by definition static.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 8.0.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |