#8227 closed bug (fixed)
cgLookupPanic (probably invalid Core
Reported by: | guest | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Compiler | Version: | 7.6.3 |
Keywords: | cgLookupPanic | Cc: | |
Operating System: | MacOS X | Architecture: | Unknown/Multiple |
Type of failure: | Compile-time crash | Test Case: | indexed_types/should_fail/T8227 |
Blocked By: | Blocking: | ||
Related Tickets: | Differential Rev(s): | ||
Wiki Page: |
Description (last modified by simonpj)
ghc: panic! (the 'impossible' happened) (GHC version 7.6.3 for x86_64-apple-darwin): cgLookupPanic (probably invalid Core; try -dcore-lint) cobox{v a34t} [lid]
Attachments (1)
Change History (5)
Changed 3 years ago by guest
comment:1 Changed 3 years ago by simonpj
comment:2 Changed 3 years ago by monoidal
- Resolution set to fixed
- Status changed from new to closed
I distilled the part that causes panic in 7.6.3 and that part gives a correct type error in HEAD.
The crucial part is this:
arcLengthToParam :: Scalar (V p) -> p -> Scalar (V p) -> Scalar (V p) absoluteToParam :: Scalar (V a) -> a -> Scalar (V a) -> Scalar (V a) absoluteToParam eps seg len = arcLengthToParam eps (arcLength eps seg - len) -- You probably wanted absoluteToParam eps seg len = arcLengthToParam eps seg (arcLength eps seg - len)
By skipping this parameter GHC has to solve Scalar (V a) ~ a and Scalar (V a) -> Scalar (V p) ~ Scalar (V p) and gets a headache. Here's a selfcontained test that panicks 7.6.3 gives occurs check in HEAD:
{-# LANGUAGE TypeFamilies #-} module V where type family V a :: * type instance V Double = Double type instance V (a -> b) = V b {-# LANGUAGE TypeFamilies #-} module Parametric ( absoluteToParam ) where import V type family Scalar a :: * type instance Scalar (a -> v) = a -> Scalar v arcLengthToParam :: Scalar (V p) -> p -> Scalar (V p) -> Scalar (V p) arcLengthToParam = undefined absoluteToParam :: Scalar (V a) -> a -> Scalar (V a) absoluteToParam eps seg = arcLengthToParam eps eps
comment:3 Changed 3 years ago by simonpj
- Description modified (diff)
- Test Case set to indexed_types/should_fail/T8227
Thank you! I've added a regression test.
comment:4 Changed 3 years ago by Simon Peyton Jones <simonpj@…>
Note: See
TracTickets for help on using
tickets.
Could someone try with HEAD? If there is a similar failure, try -dcore-lint.
I'm not sure whether this failure show up when compiling the diagrams package, or in some other way. More info on how to reproduce would be very helpful.
Thanks
Simon