Fix #16287 by checking for more unsaturated synonym arguments
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 5 Feb 2019 13:50:59 +0000 (08:50 -0500)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Wed, 6 Feb 2019 10:32:34 +0000 (05:32 -0500)
commitc07e7ecbdfc05429fb6ce84c547c0365d2754db7
tree75afd449b634e779004de566f791049a66849527
parent9292a183fd031d81ac7027eb95dd5a46249845f8
Fix #16287 by checking for more unsaturated synonym arguments

Trac #16287 shows that we were checking for unsaturated type synonym
arguments (in `:kind`) when the argument was to a type synonym, but
_not_ when the argument was to some other form of type constructor,
such as a data type. The solution is to use the machinery that
rejects unsaturated type synonym arguments (previously confined to
`check_syn_tc_app`) to `check_arg_type`, which checks these other
forms of arguments. While I was in town, I cleaned up
`check_syn_tc_app` a bit to only invoke `check_arg_type` so as to
minimize the number of different code paths that that function could
go down.
compiler/typecheck/TcValidity.hs
testsuite/tests/ghci/should_fail/T16287.script [new file with mode: 0644]
testsuite/tests/ghci/should_fail/T16287.stderr [new file with mode: 0644]
testsuite/tests/ghci/should_fail/all.T