Fix #16666 by parenthesizing contexts in Convert
Most places where we convert contexts in `Convert` are actually in positions that are to the left of some `=>`, such as in superclasses and instance contexts. Accordingly, these contexts need to be parenthesized at `funPrec`. To accomplish this, this patch changes `cvtContext` to require a precedence argument for the purposes of calling `parenthesizeHsContext` and adjusts all `cvtContext` call sites accordingly.
Showing
- compiler/hsSyn/Convert.hs 11 additions, 11 deletionscompiler/hsSyn/Convert.hs
- testsuite/tests/th/T16666.hs 11 additions, 0 deletionstestsuite/tests/th/T16666.hs
- testsuite/tests/th/T16666.stderr 7 additions, 0 deletionstestsuite/tests/th/T16666.stderr
- testsuite/tests/th/all.T 1 addition, 0 deletionstestsuite/tests/th/all.T
Loading
Please register or sign in to comment