From 78dd04f9126dc5df966070b8db4b39a517a9d99f Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Mon, 4 Mar 2019 09:52:14 -0500 Subject: Fix #16385 by appending _maybe to a use of lookupGlobalOcc `instance forall c. c` claimed that `c` was out of scope because the renamer was invoking `lookupGlobalOcc` on `c` (in `RnNames.getLocalNonValBinders`) without binding `c` first. To avoid this, this patch changes GHC to invoke `lookupGlobalOcc_maybe` on `c` instead, and if that returns `Nothing`, then bail out, resulting in a better error message. --- testsuite/tests/rename/should_fail/all.T | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite/tests/rename/should_fail/all.T') diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index af382b1a0c..4f1b1fa34b 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -146,3 +146,4 @@ test('T16114', normal, compile_fail, ['']) test('T16116b', normal, compile_fail, ['']) test('ExplicitForAllRules2', normal, compile_fail, ['']) test('T15957_Fail', normal, compile_fail, ['-Werror -Wall -Wno-missing-signatures']) +test('T16385', normal, compile_fail, ['']) -- cgit v1.2.1