Closed requested to merge luite/ghc:fix-23278 into master
This should fix #23278 (closed)
I've tested this and it fixes an issue that I had using
base, so the fix seems correct, but I don't have a testcase yet.
debugIO code into a separate testcase doesn't reproduce the problem.