GHCi does not error when typed template haskell errors in IO
Summary
If some expression using typed template haskell would cause an exception when running compile-time code, then putting that expression into IO using pure or print suppresses the error and does not execute the IO action.
Steps to reproduce
Enter GHCi with -XTemplateHaskell and run print ($$undefined :: String)
.
Expected behavior
Print an error, similar to when running ($$undefined :: String)
or print ($undefined :: String)
in GHCi.
Environment
- GHC version used: 8.10.4
Optional:
- Operating System: 5.11.1-arch1-1
- System Architecture: x86_64