diff --git a/testsuite/tests/typecheck/should_compile/T21765.hs b/testsuite/tests/typecheck/should_compile/T21765.hs new file mode 100644 index 0000000000000000000000000000000000000000..d1a25ecaae0efac019c0f2f0b6519601b49f3585 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T21765.hs @@ -0,0 +1,9 @@ +{-# LANGUAGE UndecidableInstances, FlexibleInstances #-} + +{-# OPTIONS_GHC -Wredundant-constraints #-} + +module T21765 where + +class Functor f => C f where c :: f Int + +instance (Functor f, Applicative f) => C f where c = pure 42 diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index a842adc21a95668b8daaa9cacfb609bafc74bee3..8c8d234e3d203c02c27689e0d636658d62b7d229 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -847,6 +847,7 @@ test('DeepSubsumption06', normal, compile, ['-XHaskell98']) test('DeepSubsumption07', normal, compile, ['-XHaskell2010']) test('DeepSubsumption08', normal, compile, ['']) test('DeepSubsumption09', normal, compile, ['']) +test('T21765', normal, compile, ['']) test('T21951a', normal, compile, ['-Wredundant-strictness-flags']) test('T21951b', normal, compile, ['-Wredundant-strictness-flags']) test('T21550', normal, compile, [''])