Consistent handling of dead code / absurd premises
GHC does not currently have a very consistent policy.
As pointed out in the first part of !2080 (comment 235964), GHC sometimes makes code requiring absurd constraints an error, but this only is at the top level, and only happens if the absurd constraint involves and ambiguous type variable. I see no reason why absurd constraints with ambiguous variables should be treated differently than absurd constraints without them. Ambiguity checking should have nothing to do with the dead code / absurd premise policy.
As argued in #11066 (closed), and the second part of !2080 (comment 235964), dead code is better as a warning. Otherwise valid substitutions (whether performed by the computer or humans) shouldn't cause errors one nothing would go wrong if those errors didn't exist. Also, metaprograms may have a harder time avoiding the absurd cases that humans can avoid by special-case. See 0e4e03a2 for the precedent of them warnings not errors.
- Merge !2080 (diffs)
- See if there is any more opportunity to provide warnings where we don't already.
There might be a "diagnostics race" in that plan, where we go from error to nothing and then to warning, but I wouldn't be concerned about that.