Fix #15787 by squashing a coercion hole.
In type-incorrect code, we can sometimes let a coercion hole make it through the zonker. If this coercion hole then ends up in the environment (e.g., in the type of a data constructor), then it causes trouble later. This patch avoids trouble by substituting the coercion hole for its representative CoVar. Really, any coercion would do, but the CoVar was very handy. test case: polykinds/T15787 (cherry picked from commit 4427315a)
Showing
- compiler/typecheck/TcHsSyn.hs 3 additions, 1 deletioncompiler/typecheck/TcHsSyn.hs
- testsuite/tests/polykinds/T15787.hs 19 additions, 0 deletionstestsuite/tests/polykinds/T15787.hs
- testsuite/tests/polykinds/T15787.stderr 6 additions, 0 deletionstestsuite/tests/polykinds/T15787.stderr
- testsuite/tests/polykinds/all.T 1 addition, 0 deletionstestsuite/tests/polykinds/all.T
Loading
Please register or sign in to comment