[GHC] #15577: TypeApplications-related infinite loop (GHC 8.6+ only)

GHC ghc-devs at haskell.org
Wed Aug 29 19:23:36 UTC 2018


#15577: TypeApplications-related infinite loop (GHC 8.6+ only)
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  high              |            Milestone:  8.6.1
       Component:  Compiler (Type    |              Version:  8.5
  checker)                           |             Keywords:
      Resolution:                    |  TypeApplications, TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 Here's a somewhat smaller example:

 {{{#!hs
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE TypeInType #-}
 {-# LANGUAGE TypeOperators #-}
 module Bug where

 import Data.Kind
 import Data.Proxy
 import Data.Type.Equality

 type family F (x :: f (a :: k)) :: f a

 f :: forall k (f :: k -> Type) (a :: k) (r :: f a). Proxy r -> F r :~: r
 f = undefined

 g :: forall (f :: Type -> Type) (a :: Type) (r :: f a). Proxy r -> F r :~:
 r
 g r | Refl <- f -- Uncommenting the line below makes it work again
                 -- @Type
                 @f @a @r r
     = Refl
 }}}

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


More information about the ghc-tickets mailing list