[GHC] #7778: kindFunResult panic with => inside a constraint
#7778: kindFunResult panic with => inside a constraint -----------------------------+---------------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Component: Compiler (Type checker) Version: 7.6.2 | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- Following type (found by arkeet on #haskell) causes kindFunResult panic in 7.6 and HEAD: {{{ v :: ((Num Int => Num) ()) => () v = v }}} In a probably related issue, {{{ Prelude> :set -XFlexibleContexts -XRankNTypes Prelude> type T = Num Int => Num Bool Prelude> :k T T :: Constraint Prelude> :k Num Int => Num Bool Num Int => Num Bool :: * }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7778> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7778: kindFunResult panic with => inside a constraint ----------------------------------------+----------------------------------- Reporter: monoidal | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler (Type checker) | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ----------------------------------------+----------------------------------- Changes (by igloo): * owner: => simonpj * difficulty: => Unknown * milestone: => 7.8.1 Comment: {{{ [1 of 1] Compiling Main ( q.hs, interpreted ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.7.20130409 for x86_64-unknown-linux): kindFunResult <<details unavailable>> }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7778#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7778: kindFunResult panic with => inside a constraint ----------------------------------------+----------------------------------- Reporter: monoidal | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler (Type checker) | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ----------------------------------------+----------------------------------- Comment(by parcs): FYI the first code snippet produces a different panic with a DEBUG build of GHC. Panic with DEBUG build: {{{ ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.7.20130416 for x86_64-unknown-linux): ASSERT failed! file compiler/types/Type.lhs line 1623 base:GHC.Num.Num{tc 2b} ghc-prim:GHC.Types.Int{(w) tc 3J} => base:GHC.Num.Num{tc 2b} ghc-prim:GHC.Prim.*{(w) tc 34d} -> ghc-prim:GHC.Prim.Constraint{(w) tc 34s} }}} Panic with non-DEBUG buird: {{{ [1 of 1] Compiling Main ( q.hs, interpreted ) ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.7.20130421 for x86_64-unknown-linux): kindFunResult ghc-prim:GHC.Prim.*{(w) tc 34d} }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7778#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7778: kindFunResult panic with => inside a constraint ----------------------------------------+----------------------------------- Reporter: monoidal | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: 7.8.1 Component: Compiler (Type checker) | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ----------------------------------------+----------------------------------- Comment(by simonpj@…): commit d3149f6096a987e94d4989e537c1a133bcbb9a6f {{{ Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Mon Apr 29 17:26:17 2013 +0100 Tighten up on the kind checking for foralls In particular, (forall a. Num a => ...) always has kind *, becuase the "=>" really is a function. It turned out that this was at the bottom of the crash in Trac #7778, which is now fixed compiler/typecheck/TcHsType.lhs | 31 ++++++++++++++++++++++++------- compiler/typecheck/TcValidity.lhs | 16 +++++++++------- 2 files changed, 33 insertions(+), 14 deletions(-) }}} -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7778#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#7778: kindFunResult panic with => inside a constraint ------------------------------------------+--------------------------------- Reporter: monoidal | Owner: simonpj Type: bug | Status: closed Priority: normal | Milestone: 7.8.1 Component: Compiler (Type checker) | Version: 7.6.2 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: typecheck/should_fail/T7778 | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Changes (by simonpj): * status: new => closed * testcase: => typecheck/should_fail/T7778 * resolution: => fixed Comment: Thanks for the test case. It showed up a real infelicity. Simon -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7778#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC