This bug was fixed at some point between GHC 9.0 and GHC 9.2; this patch simply adds a regression test.