[GHC] #16152: Core lint error from PartialTypeSignatures

GHC ghc-devs at haskell.org
Fri Feb 1 13:43:48 UTC 2019


#16152: Core lint error from PartialTypeSignatures
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.7
      Resolution:                    |             Keywords:
                                     |  PartialTypeSignatures
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 The program in comment:1 has some strange interactions w.r.t.
 `MonoLocalBinds`. This program compiles:

 {{{#!hs
 {-# Language PartialTypeSignatures #-}
 {-# Language PolyKinds             #-}
 {-# Language ScopedTypeVariables   #-}
 {-# Language TypeApplications      #-}

 import GHC.Exts

 top :: forall f. _
 top = undefined

 f = top @Any
 }}}

 But if you compile it with `MonoLocalBinds`, then it doesn't:

 {{{
 $ /opt/ghc/8.6.3/bin/ghci Bug.hs -XMonoLocalBinds
 GHCi, version 8.6.3: http://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 [1 of 1] Compiling Main             ( Bug.hs, interpreted )

 Bug.hs:11:10: error:
     • Expected kind ‘k’, but ‘Any’ has kind ‘k00’
     • In the type ‘Any’
       In the expression: top @Any
       In an equation for ‘f’: f = top @Any
    |
 11 | f = top @Any
    |          ^^^
 }}}

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


More information about the ghc-tickets mailing list