From dddb689f6dd16e19de649043d34dc1712973c639 Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Tue, 17 May 2022 11:34:04 +0100 Subject: Add test for #21558 This is now fixed on master and 9.2 branch. Closes #21558 --- testsuite/tests/typecheck/should_compile/T21558.hs | 16 ++++++++++++++++ testsuite/tests/typecheck/should_compile/all.T | 1 + 2 files changed, 17 insertions(+) create mode 100644 testsuite/tests/typecheck/should_compile/T21558.hs diff --git a/testsuite/tests/typecheck/should_compile/T21558.hs b/testsuite/tests/typecheck/should_compile/T21558.hs new file mode 100644 index 0000000000..156590e640 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T21558.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableInstances #-} +module T21558 where + +import Data.Map + +type family IxValue (m :: *) :: * +type family Index (m :: *) :: * + +data Op a where + Insert :: (a ~ Map (Index a) (IxValue a)) => (Int, Index a, IxValue a) -> Op a + +instance Eq (Op a) where + +instance (Ord (Index a), Ord (IxValue a), Ord a) => Ord (Op a) where + compare (Insert a1) (Insert b1) = compare a1 b1 diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 4f546c0914..e9596fb6f4 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -804,6 +804,7 @@ test('T20187a', normal, compile, ['-Wredundant-strictness-flags']) test('T20187b', normal, compile, ['-Wredundant-strictness-flags']) test('T20356', normal, compile, ['']) test('T20584', normal, compile, ['']) +test('T21558', normal, compile, ['-w']) test('T20584b', normal, compile, ['']) test('T20588b', [extra_files(['T20588b.hs', 'T20588b.hs-boot', 'T20588b_aux.hs'])], multimod_compile, ['T20588b_aux.hs', '-v0']) test('T20588d', [extra_files(['T20588d.hs', 'T20588d.hs-boot', 'T20588d_aux.hs'])], multimod_compile, ['T20588d_aux.hs', '-v0']) -- cgit v1.2.1