Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#9222 closed bug (fixed)

Unexpected DataKind Panic

Reported by: ekmett Owned by:
Priority: normal Milestone: 7.8.3
Component: Compiler (Type checker) Version: 7.8.2
Keywords: Cc: ekmett
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: polykinds/T9222
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Here's a simplified version of a panic I'm getting:

{-# LANGUAGE RankNTypes, GADTs, DataKinds, PolyKinds, TypeOperators, TypeFamilies #-}
import Data.Proxy
data Want :: (i,j) -> * where
  Want :: (a ~ '(b,c) => Proxy b) -> Want a
GHCi, version 7.8.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
ghc: panic! (the 'impossible' happened)
  (GHC version 7.8.2 for x86_64-apple-darwin):
	tcTyVarDetails k{tv aAv} [tv]

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

Change History (6)

comment:1 Changed 3 years ago by ekmett

If I fix up the quantifiers then the panic goes away, but the 'impossible' shouldn't happen, nonetheless. ;)

comment:2 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In 2be99d2309471bc75ddb9cb47acda9ccbcb7ab63/ghc:

In TcValidity.checkAmbiguity, skolemise kind vars that appear free in the kinds of type variables

This was shown up by Trac #9222.

comment:3 Changed 3 years ago by simonpj

Milestone: 7.8.4
Status: newmerge
Test Case: polykinds/T9222

Merge if we ever do 7.8.4

comment:4 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

comment:5 Changed 3 years ago by thoughtpolice

Milestone: 7.8.47.8.3
Resolution: fixed
Status: mergeclosed

comment:6 Changed 3 years ago by Simon Peyton Jones <simonpj@…>

In b82410ab8908f1ec2a6aa14cce62948c92bcbce9/ghc:

Trac #9222 is actually an ambiguous type, now detected
Note: See TracTickets for help on using tickets.