Interactive linker crash when partially applying seq#
Consider the following commands:
:set -XMagicHash import GHC.IO import GHC.Prim IO (seq# ())
When the last statement is run in GHCi, the following error message is displayed:
ByteCodeLink.lookupCE(primop) During interactive linking, GHCi couldn't find the following symbol: ghczmprim_GHCziPrimopWrappers_seqzh_closure This may be due to you not asking GHCi to load extra object files, archives or DLLs needed by your current session. Restart GHCi, specifying the missing library using the -L/path/to/object/dir and -lmissinglibname flags, or simply by naming the relevant files on the GHCi command line. Alternatively, this link failure might indicate a bug in GHCi. If you suspect the latter, please send a bug report to: email@example.com
The expression works if I eta-unreduce the
IO (\x -> seq# () x).
The problem seems to be exclusive to GHCi: if you put that expression in a file, it works fine when compiled by GHC, and even GHCi works fine when using the resulting
When there's no
.o GHCi still crashes, and eta-unreduction doesn't help anymore (something to with optimizations I guess).
I can also reproduce this on the Linux-x86 architecture.