Skip to content

Missing warning for a run-time pattern match failure

Summary

I am working with a very restrictive set of warnings and lately adopted the use of incomplete-patterns, incomplete-record-updates, and incomplete-uni-patterns with the goal of seeing all locations where a run-time pattern match failure might occur.

I've found an issue today where I am not warned by GHC, and boiled it down to a very small example. It's possible that I'm just missing another available warning flag.

Steps to reproduce

main :: IO ()
main = do
  [a] <- pure []
  putStrLn a

Expected behavior

I'd like to be warned about this run-time pattern match failure.

Environment

  • GHC version used: 8.8.3 (via Stack)

Optional:

  • Operating System: Windows 10
  • System Architecture: x64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information