diff options
author | Richard Eisenberg <rae@richarde.dev> | 2022-03-02 10:38:38 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-02 14:11:03 -0500 |
commit | c8652a0afc3d8b56d39f39ff587271dcc46b17ba (patch) | |
tree | 67417eb34ae8bd41da46f336d9b230422af2fa30 /testsuite | |
parent | 1617fed3a97cd13b55a180029ab8fb9468d2b797 (diff) | |
download | haskell-c8652a0afc3d8b56d39f39ff587271dcc46b17ba.tar.gz |
Make Constraint not *apart* from Type.
More details in Note [coreView vs tcView]
Close #21092.
Diffstat (limited to 'testsuite')
6 files changed, 17 insertions, 10 deletions
diff --git a/testsuite/tests/indexed-types/should_fail/T21092.hs b/testsuite/tests/indexed-types/should_fail/T21092.hs new file mode 100644 index 0000000000..7b92656d46 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/T21092.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE TypeFamilies #-} +module T21092 where + +import Data.Kind + +type family F a + +type instance F Type = Int +type instance F Constraint = Bool diff --git a/testsuite/tests/indexed-types/should_fail/T21092.stderr b/testsuite/tests/indexed-types/should_fail/T21092.stderr new file mode 100644 index 0000000000..b5b211cb38 --- /dev/null +++ b/testsuite/tests/indexed-types/should_fail/T21092.stderr @@ -0,0 +1,5 @@ + +T21092.hs:8:15: error: + Conflicting family instance declarations: + F (*) = Int -- Defined at T21092.hs:8:15 + F Constraint = Bool -- Defined at T21092.hs:9:15 diff --git a/testsuite/tests/indexed-types/should_fail/all.T b/testsuite/tests/indexed-types/should_fail/all.T index c5321fc455..5338a8780f 100644 --- a/testsuite/tests/indexed-types/should_fail/all.T +++ b/testsuite/tests/indexed-types/should_fail/all.T @@ -107,6 +107,7 @@ test('T8368', normal, compile_fail, ['']) test('T8368a', normal, compile_fail, ['']) test('T8518', normal, compile_fail, ['']) test('T9036', normal, compile_fail, ['']) +test('T21092', normal, compile_fail, ['']) test('T9167', normal, compile_fail, ['']) test('T9171', normal, compile_fail, ['']) test('T9097', normal, compile_fail, ['']) diff --git a/testsuite/tests/linters/notes.stdout b/testsuite/tests/linters/notes.stdout index 64d17088b5..224fade77a 100644 --- a/testsuite/tests/linters/notes.stdout +++ b/testsuite/tests/linters/notes.stdout @@ -20,7 +20,6 @@ ref compiler/GHC/Core/TyCon.hs:2442:62: Note [Sharing nullary TyCons] ref compiler/GHC/Core/Unfold.hs:1171:23: Note [INLINE for small functions (3)] ref compiler/GHC/Core/Unfold.hs:1242:50: Note [Unfold info lazy contexts] ref compiler/GHC/Core/Unfold/Make.hs:157:34: Note [DFunUnfoldings] -ref compiler/GHC/Core/Unify.hs:544:16: Note [Unification result] ref compiler/GHC/Core/Unify.hs:1390:9: Note [INLINE pragmas and (>>)] ref compiler/GHC/Core/Utils.hs:947:40: Note [ _ -> [con1] ref compiler/GHC/CoreToStg.hs:462:15: Note [Nullary unboxed tuple] diff --git a/testsuite/tests/typecheck/should_run/T11715.hs b/testsuite/tests/typecheck/should_run/T11715.hs index 3baeb12de9..e8522fe9ee 100644 --- a/testsuite/tests/typecheck/should_run/T11715.hs +++ b/testsuite/tests/typecheck/should_run/T11715.hs @@ -3,17 +3,10 @@ import Data.Kind import Data.Typeable -type family F x a b -type instance F Type a b = a -type instance F Constraint a b = b - -foo :: x :~: y -> F x a b -> F y a b -foo Refl = id - unsafeCoerce :: a -> b unsafeCoerce x = case eqT :: Maybe (Type :~: Constraint) of Nothing -> error "No more bug!" - Just r -> foo r x + Just r -> error "Bug!" main :: IO () main = let x :: Int diff --git a/testsuite/tests/typecheck/should_run/T11715.stderr b/testsuite/tests/typecheck/should_run/T11715.stderr index 6b7b2dd10b..ef267fa85f 100644 --- a/testsuite/tests/typecheck/should_run/T11715.stderr +++ b/testsuite/tests/typecheck/should_run/T11715.stderr @@ -1,3 +1,3 @@ T11715: No more bug! CallStack (from HasCallStack): - error, called at T11715.hs:15:31 in main:Main + error, called at T11715.hs:8:31 in main:Main |