diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-05-17 11:34:04 +0100 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2022-05-25 19:03:35 +0530 |
commit | f900d638a15e49c036f768a82a0338545aee89f2 (patch) | |
tree | ba5462a2d9b0e7ec75941d203b0d56fb1a54f975 | |
parent | a2dbf068aec6dc341a68e765d61fe7f5eed8c6b2 (diff) | |
download | haskell-f900d638a15e49c036f768a82a0338545aee89f2.tar.gz |
Add test for #21558
This is now fixed on master and 9.2 branch.
Closes #21558
(cherry picked from commit 0e2d16eb76037152c96226f0f65a5ebdee64f7b6)
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T21558.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
2 files changed, 17 insertions, 0 deletions
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 57110891f1..ae0a917629 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -788,6 +788,7 @@ test('T18467', normal, compile, ['']) test('T19315', normal, compile, ['']) test('T19535', normal, compile, ['']) +test('T21558', normal, compile, ['-w']) test('T21516', normal, compile, ['']) test('T21519', normal, compile, ['']) test('T21519a', normal, compile, ['']) |