Commit 2f9f1f86 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add a missing addDeferredBinding

I'd forgotten to add deferred bindings for user type
errors.  Fixes Trac #13487.
parent 48daaaf0
......@@ -611,7 +611,8 @@ mkHoleReporter ctxt
mkUserTypeErrorReporter :: Reporter
mkUserTypeErrorReporter ctxt
= mapM_ $ \ct -> do { err <- mkUserTypeError ctxt ct
; maybeReportError ctxt err }
; maybeReportError ctxt err
; addDeferredBinding ctxt err ct }
mkUserTypeError :: ReportErrCtxt -> Ct -> TcM ErrMsg
mkUserTypeError ctxt ct = mkErrorMsgFromCt ctxt ct
......
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fdefer-type-errors #-}
module T13487 where
import Data.Kind (Constraint)
import GHC.TypeLits
data Foo a b where
K :: Error a b => a -> b -> Foo a b
type family Error a b :: Constraint where
Error Int Int = ()
Error _ _ = TypeError ('Text "GHC panic in 3... 2... 1...")
foo = K 'a' 'b'
T13487.hs:19:7: warning: [-Wdeferred-type-errors (in -Wdefault)]
• GHC panic in 3... 2... 1...
• In the expression: K 'a' 'b'
In an equation for ‘foo’: foo = K 'a' 'b'
......@@ -427,6 +427,7 @@ test('StrictBinds', normal, compile_fail, [''])
test('T13068', [extra_files(['T13068.hs', 'T13068a.hs', 'T13068.hs-boot', 'T13068m.hs'])], multimod_compile_fail, ['T13068m', ''])
test('T13105', normal, compile_fail, [''])
test('LevPolyBounded', normal, compile_fail, [''])
test('T13487', normal, compile, [''])
test('T13292', normal, multimod_compile, ['T13292', '-v0 -fdefer-type-errors'])
test('T13300', normal, compile_fail, [''])
test('T12709', normal, compile_fail, [''])
......
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