Multiple occurrence of the same out-of-scope identifier should be commoned up
If I say x = _blah _blah
, I get two errors, one for each of the out-of-scope _blah
s. What's strange is that the two have different types! Though the example here won't work for any (monomorphic) type, in more elaborate cases, users might want to find some function or variable that fits in several different places in their code. GHC should do them the favor of giving each occurrence of the same out-of-scope identifier the same type. Note that _
is not an identifier, so multiple uses of _
would indeed be different.
Inspired by this YouTube comment.
cc @Tritlo