PmCheck: Long-distance information for let guards
As @RyanGlScott points out, the coverage checker currently doesn't reason about let guards from source. Example:
{-# OPTIONS_GHC -Wincomplete-patterns -fforce-recomp #-}
module Lib where
x :: ()
x | let y = True, y = ()
test.hs:9:1: warning: [-Wincomplete-patterns]
Pattern match(es) are non-exhaustive
In an equation for ‘x’: Guards do not cover entire pattern space
|
9 | x | let y = True, y = ()
| ^^^^^^^^^^^^^^^^^^^^^^^^
That's rather ironic, given that we basically desugar all kinds of more complex pattern match features into just such a let guard in our LYG IR. Should be a pretty easy fix.