Fix #13777 by improving the underdetermined CUSK error message
The error message that GHC emits from underdetermined CUSKs is rather poor, since: 1. It may print an empty list of user-written variables if there are none in the declaration. 2. It may not mention any `forall`-bound, underdetermined variables in the result kind. To resolve these issues, this patch: 1. Doesn't bother printing a herald about user-written variables if there are none. 2. Prints the result kind to advertise any underdetermination it may exhibit. Test Plan: make test TEST=T13777 Reviewers: goldfire, bgamari Reviewed By: goldfire Subscribers: rwbarton, thomie, carter GHC Trac Issues: #13777 Differential Revision: https://phabricator.haskell.org/D4771
Showing
- compiler/typecheck/TcHsType.hs 10 additions, 4 deletionscompiler/typecheck/TcHsType.hs
- testsuite/tests/indexed-types/should_fail/T13777.hs 14 additions, 0 deletionstestsuite/tests/indexed-types/should_fail/T13777.hs
- testsuite/tests/indexed-types/should_fail/T13777.stderr 20 additions, 0 deletionstestsuite/tests/indexed-types/should_fail/T13777.stderr
- testsuite/tests/indexed-types/should_fail/all.T 1 addition, 0 deletionstestsuite/tests/indexed-types/should_fail/all.T
- testsuite/tests/polykinds/T11648b.stderr 1 addition, 0 deletionstestsuite/tests/polykinds/T11648b.stderr
- testsuite/tests/typecheck/should_fail/T14904a.stderr 1 addition, 0 deletionstestsuite/tests/typecheck/should_fail/T14904a.stderr
Loading
Please register or sign in to comment