Fix #12709 by not building bad applications
authorRichard Eisenberg <rae@cs.brynmawr.edu>
Thu, 16 Mar 2017 14:34:29 +0000 (10:34 -0400)
committerRichard Eisenberg <rae@cs.brynmawr.edu>
Fri, 17 Mar 2017 15:23:13 +0000 (11:23 -0400)
commitdca44adb9e14992e0aed49cdfd4b2baa2182073b
tree887e2093f942fff75e1ad666cd194446592e8d22
parent4dc993008a66d6a54909da462363a25e8449f000
Fix #12709 by not building bad applications

In an effort to report multiple levity polymorphism errors all at
once, the desugarer does not fail when encountering bad levity
polymorphism. But we must be careful not to build the bad applications,
lest they try to satisfy the let/app invariant and call
isUnliftedType on a levity polymorphic type. This protects calls
to mkCoreAppDs appropriately.

test case: typecheck/should_fail/T12709
compiler/coreSyn/MkCore.hs
compiler/deSugar/DsBinds.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsMonad.hs
compiler/deSugar/DsUtils.hs
testsuite/tests/typecheck/should_fail/T12709.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/T12709.stderr [new file with mode: 0644]
testsuite/tests/typecheck/should_fail/all.T