diff options
-rw-r--r-- | compiler/GHC/Tc/Validity.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T20033.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs index 41e1a1c5a9..3c664cb06e 100644 --- a/compiler/GHC/Tc/Validity.hs +++ b/compiler/GHC/Tc/Validity.hs @@ -1586,6 +1586,7 @@ check_special_inst_head dflags is_boot is_sig ctxt clas cls_args InstDeclCtxt stand_alone -> not stand_alone SpecInstCtxt -> False DerivClauseCtxt -> False + SigmaCtxt -> False _ -> True check_h98_arg_shape = case ctxt of diff --git a/testsuite/tests/typecheck/should_compile/T20033.hs b/testsuite/tests/typecheck/should_compile/T20033.hs new file mode 100644 index 0000000000..24323a238b --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T20033.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE ConstraintKinds #-} + +module T20033 where + +import Data.Typeable + +data Some c where + Some :: c a => a -> Some c + +extractSome :: (Typeable a, forall x. c x => Typeable x) => Some c -> Maybe a +extractSome (Some a) = cast a diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 429ac69ce0..a275d5196a 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -792,3 +792,4 @@ test('T18481', normal, compile, ['']) test('T18481a', normal, compile, ['']) test('T19775', normal, compile, ['']) test('T17817b', normal, compile, ['']) +test('T20033', normal, compile, ['']) |