mirrored from https://gitlab.haskell.org/ghc/ghc.git
-
Notifications
You must be signed in to change notification settings - Fork 705
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I'd forgotten to add deferred bindings for user type errors. Fixes Trac #13487.
- Loading branch information
Simon Peyton Jones
committed
Apr 6, 2017
1 parent
48daaaf
commit 2f9f1f8
Showing
4 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{-# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters