Skip to content

Panic on foreign import capi "wrapper"

Summary

The following (bad) haskell file causes GHC to panic:

{-# LANGUAGE CApiFFI #-}

import Foreign

foreign import capi "wrapper"
  wrapBool :: Bool -> IO (FunPtr Bool)

main = pure ()

Expected behavior

foreign import capi "wrapper" is probably nonsense, but I don't think it should trigger a panic.

Environment

  • GHC version used:
The Glorious Glasgow Haskell Compilation System, version 9.3.20210806

Optional:

  • Operating System: NixOS
  • System Architecture: x86_64-pc-linux-gnu
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information