Avoid double error on out-of-scope identifier
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 21 Apr 2016 13:34:07 +0000 (14:34 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 22 Apr 2016 10:32:39 +0000 (11:32 +0100)
commitc2b7a3d9f6ad946a2cb2773e96a377cc2216cb5b
treec32da020d781d119b783d0b41f385a6e490e590e
parent24d3276df62b52bdf720f4789ff9ddbbb7c02cec
Avoid double error on out-of-scope identifier

Trac #11941 demonstrated a case where an out-of-scope error also
gave rise to a (bogus and confusing) stage restriction message.

It's caused by the fact that out-of-scope errors do not stop
renaming, but rather return an "unbound name".  We need to
detect this in the stage-restriction test to avoid the double
error.  Easy fix.
compiler/typecheck/TcEnv.hs
testsuite/tests/th/T11941.hs [new file with mode: 0644]
testsuite/tests/th/T11941.stderr [new file with mode: 0644]
testsuite/tests/th/all.T