Skip to content

Something is amuck with template-haskell #40

@ahubers

Description

@ahubers

What

When building unordered-containers w/ PTC, I am getting a panic from GHC for this instance in Data/HashMap/Internal/Array.hs:

instance TH.Lift a => TH.Lift (Array a) where
#if MIN_VERSION_template_haskell(2,16,0)
  liftTyped ar = [|| fromList' arlen arlist ||]
#else
  lift ar = [| fromList' arlen arlist |]
#endif
    where
      arlen :: Int
      arlen = I# (sizeofSmallArray# (unArray ar))
      arlist = toList ar

The panic is:

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.3.20220511:
	bind_args
  I#
  [ww, ww, ww]
  [sizeofSmallArray# @a ds]
  scrut: I# (sizeofSmallArray# @a ds)
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:186:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Opt/Simplify.hs:3307:7 in ghc:GHC.Core.Opt.Simplify

I am kicking this issue down the river by commenting out any Template-Haskell support. Logging here for now.

Reproduction Steps

Follow instructions here to build unordered-containers package. Uncomment the instance TH.Lif a => ... line above in Data/Hashmap/Internal/Array.hs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Low PriorityThings that are good to have but not neededbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions