Commit feca929b authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Fix 'unsolved constraints' in GHCi

In initTc, if the computation fails with an exception, we
should not complain about unsolved constraints.

Fixes Trac #13466.
parent e0ad55f8
......@@ -336,11 +336,14 @@ initTcWithGbl hsc_env gbl_env loc do_this
Right res -> return (Just res)
Left _ -> return Nothing }
-- Check for unsolved constraints
-- Check for unsolved constraints
-- If we succeed (maybe_res = Just r), there should be
-- no unsolved constraints. But if we exit via an
-- exception (maybe_res = Nothing), we may have skipped
-- solving, so don't panic then (Trac #13466)
; lie <- readIORef (tcl_lie lcl_env)
; if isEmptyWC lie
then return ()
else pprPanic "initTc: unsolved constraints" (ppr lie)
; when (isJust maybe_res && not (isEmptyWC lie)) $
pprPanic "initTc: unsolved constraints" (ppr lie)
-- Collect any error messages
; msgs <- readIORef (tcl_errs lcl_env)
:set -XTypeApplications
:t out_of_scope @[]
<interactive>:1:1: error:
• Cannot apply expression of type ‘t1’
to a visible type argument ‘[]’
• In the expression: out_of_scope @[]
......@@ -250,3 +250,4 @@ test('T12550', normal, ghci_script, ['T12550.script'])
test('StaticPtr', normal, ghci_script, ['StaticPtr.script'])
test('T13202', normal, ghci_script, ['T13202.script'])
test('T13202a', normal, ghci_script, ['T13202a.script'])
test('T13466', normal, ghci_script, ['T13466.script'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment