Opened 6 months ago

Closed 5 months ago

#12844 closed bug (fixed)

No Skolem Info with PartialTypeSignatures

Reported by: crockeea Owned by:
Priority: normal Milestone: 8.0.2
Component: Compiler Version: 8.0.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Compile-time crash or panic Test Case: partial-sigs/should_compile/T12844
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by bgamari)

The following program triggers a panic:

{-# LANGUAGE DataKinds             #-}
{-# LANGUAGE PartialTypeSignatures #-}
{-# LANGUAGE PolyKinds             #-}
{-# LANGUAGE TypeFamilies          #-}
{-# LANGUAGE TypeOperators         #-}

barWraper :: ('(r,r') ~ Head rngs, Foo rngs) => FooData rngs
barWraper = bar

bar :: (_) => FooData rngs
bar = foo

data FooData rngs

class Foo xs where foo :: (Head xs ~ '(r,r')) => FooData xs

type family Head (xs :: [k]) where Head (x ': xs) = x
> ghci NoSkolem.hs
[1 of 1] Compiling Main             ( NoSkolem.hs, NoSkolem.o )

NoSkolem.hs:8:13: error:ghc: panic! (the 'impossible' happened)
  (GHC version 8.0.1 for x86_64-unknown-linux):
	No skolem info: k_aYV[sk]

I haven't tested with 8.0.2 or head.

Change History (3)

comment:1 Changed 5 months ago by Simon Peyton Jones <simonpj@…>

In 1bfff60f/ghc:

Fix inference of partial signatures

When we had
  f :: ( _ ) => blah
we were failing to call growThetaTyVars, as we do in the
no-type-signature case, and that meant that we weren't generalising
over the right type variables.  I'm quite surprised this didn't cause
problems earlier.

Anyway Trac #12844 showed it up and this patch fixes it

comment:2 Changed 5 months ago by simonpj

Status: newmerge
Test Case: partial-sigs/should_compile/T12844

This fix is fairly simple and might be worth merging to 8.0. Try, anyway.

comment:3 Changed 5 months ago by bgamari

Description: modified (diff)
Milestone: 8.0.2
Resolution: fixed
Status: mergeclosed
Note: See TracTickets for help on using tickets.