[GHC] #13305: static: check for identifiers should only consider term level variables

GHC ghc-devs at haskell.org
Mon Feb 20 11:04:14 UTC 2017


#13305: static: check for identifiers should only consider term level variables
-------------------------------------+-------------------------------------
           Reporter:  edsko          |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Consider

 {{{#!hs
 {-# 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.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13305>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list