diff options
-rw-r--r-- | compiler/typecheck/TcHsType.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T16033.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 3b36281d4a..56a0ea0c34 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -2323,7 +2323,11 @@ tcHsPatSigType ctxt sig_ty = addSigCtxt ctxt hs_ty $ do { sig_tkvs <- mapM new_implicit_tv sig_vars ; (wcs, sig_ty) - <- tcWildCardBinders sig_wcs $ \ wcs -> + <- solveLocalEqualities "tcHsPatSigType" $ + -- Always solve local equalities if possible, + -- else casts get in the way of deep skolemisation + -- (Trac #16033) + tcWildCardBinders sig_wcs $ \ wcs -> tcExtendTyVarEnv sig_tkvs $ do { sig_ty <- tcHsOpenType hs_ty ; return (wcs, sig_ty) } diff --git a/testsuite/tests/typecheck/should_compile/T16033.hs b/testsuite/tests/typecheck/should_compile/T16033.hs new file mode 100644 index 0000000000..09be024af4 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T16033.hs @@ -0,0 +1,7 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +module T16033 where + +f :: (forall x. x -> forall y. y -> c) -> () +f (_ :: forall a. a -> forall b. b -> c) = () diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index a8e8cfe910..3fed2a9466 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -657,3 +657,4 @@ test('T15645', normal, compile, ['-Wwarn=missing-monadfail-instances']) test('T15778', normal, compile, ['']) test('T14761c', normal, compile, ['']) test('T16008', normal, compile, ['']) +test('T16033', normal, compile, ['']) |