[GHC] #15807: GHC panic with visible kind applications
 
            #15807: GHC panic with visible kind applications ----------------------------------------+--------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Keywords: TypeApplications | Operating System: Linux Architecture: Unknown/Multiple | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: ----------------------------------------+--------------------------------- Using the https://phabricator.haskell.org/D5229 diff This is '''fine''' {{{#!hs {-# Language RankNTypes #-} {-# Language TypeApplications #-} {-# Language PolyKinds #-} {-# Language GADTs #-} import Data.Kind data App :: forall (f :: Type -> Type). Type -> Type where MkApp :: f a -> App @f a }}} Kind polymorphic is '''fine''' {{{#!hs {-# Language RankNTypes #-} {-# Language TypeApplications #-} {-# Language PolyKinds #-} {-# Language GADTs #-} import Data.Kind data App :: forall k (f :: k -> Type). k -> Type where MkApp :: f a -> App @k @(f :: k -> Type) (a :: k) }}} But offing the visibility of `k` '''fails''' {{{#!hs {-# Language RankNTypes #-} {-# Language TypeApplications #-} {-# Language PolyKinds #-} {-# Language GADTs #-} import Data.Kind data App :: forall (f :: k -> Type). k -> Type where MkApp :: f a -> App @(f :: k -> Type) (a :: k) }}} {{{#!hs {-# Language RankNTypes #-} {-# Language TypeApplications #-} {-# Language PolyKinds #-} {-# Language GADTs #-} import Data.Kind data App :: forall (f :: k -> Type). k -> Type where MkApp :: f a -> App @f a }}} {{{ $ ghci -ignore-dot-ghci 581_bug.hs GHCi, version 8.7.20181017: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( 581_bug.hs, interpreted ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.7.20181017 for x86_64-unknown-linux): ASSERT failed! 2 1 f_a1yB[tau:1] f_a1yx[sk:1] Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1160:37 in ghc:Outputable pprPanic, called at compiler/utils/Outputable.hs:1219:5 in ghc:Outputable assertPprPanic, called at compiler/typecheck/TcMType.hs:778:54 in ghc:TcMType Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
}}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15807 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
 
            #15807: GHC panic with visible kind applications ---------------------------------+---------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.1 Resolution: | Keywords: TypeApplications Operating System: Linux | Architecture: Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by goldfire): The types involved here do not have CUSKs. Since My's last rebase, I've committed a major change to the way non-CUSK types are handled, in a way that will likely affect GHC's behavior here. I'm hoping that when she rebases, this panic will go away. Regardless, more good fodder for the test suite. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15807#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
 
            #15807: GHC panic with visible kind applications
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.6.1
      Resolution:  fixed             |             Keywords:
                                     |  TypeApplications
Operating System:  Linux             |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  typecheck/should_fail/T15807
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5229
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):
 * status:  new => closed
 * testcase:   => typecheck/should_fail/T15807
 * differential:   => Phab:D5229
 * resolution:   => fixed
 * milestone:   => 8.8.1
Comment:
 This was fixed in
 [https://gitlab.haskell.org/ghc/ghc/commit/17bd163566153babbf51adaff8397f948a...
 17bd163566153babbf51adaff8397f948ae363ca]:
 {{{
 Author: mynguyen 
 
            #15807: GHC panic with visible kind applications
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.6.1
      Resolution:  fixed             |             Keywords:
                                     |  TypeApplications
Operating System:  Linux             |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
                                     |  typecheck/should_fail/T15807
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5229
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Comment (by Richard Eisenberg 
participants (1)
- 
                 GHC GHC