[GHC] #16376: GHCi HEAD silently accepts ill-kinded visible type applications with :type

GHC ghc-devs at haskell.org
Tue Mar 5 14:42:30 UTC 2019


#16376: GHCi HEAD silently accepts ill-kinded visible type applications with :type
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:
       Component:  GHCi              |              Version:  8.9
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Combining this with `-fdefer-type-errors` leads to a panic:

 {{{
 GHCi, version 8.9.20190227: https://www.haskell.org/ghc/  :? for help
 Loaded GHCi configuration from /home/rgscott/.ghci
 λ> :set -XTypeApplications -fdefer-type-errors
 λ> f = id @Maybe

 <interactive>:2:9: warning: [-Wdeferred-type-errors]
     • Expecting one more argument to ‘Maybe’
       Expected a type, but ‘Maybe’ has kind ‘* -> *’
     • In the type ‘Maybe’
       In the expression: id @Maybe
       In an equation for ‘f’: f = id @Maybe
 ghc-stage2: panic! (the 'impossible' happened)
   (GHC version 8.9.20190227 for x86_64-unknown-linux):
         nameModule
   internal f_a1BS
   Call stack:
       CallStack (from HasCallStack):
         callStackDoc, called at compiler/utils/Outputable.hs:1159:37 in
 ghc:Outputable
         pprPanic, called at compiler/basicTypes/Name.hs:249:3 in ghc:Name
 }}}

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


More information about the ghc-tickets mailing list