diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2019-03-13 13:09:19 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-16 08:08:25 -0400 |
commit | 600a1ac3829c2b216d2cc23a1e8256841ffe6466 (patch) | |
tree | 9a3b97fbc6a6b2874f5297c332de09f5c0c9b462 /compiler | |
parent | 4927117cd6166a97455d788dbf7433c95441b57a (diff) | |
download | haskell-600a1ac3829c2b216d2cc23a1e8256841ffe6466.tar.gz |
Add location to the extra-constraints wildcard
The extra-constraints wildcard had lost its location
(issue #16431).
Happily this is easy to fix. Lots of error improvements.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/typecheck/TcHsType.hs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index 7438c4823b..489a35c455 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -2479,7 +2479,7 @@ tcHsPartialSigType , TcType ) -- Tau part -- See Note [Recipe for checking a signature] tcHsPartialSigType ctxt sig_ty - | HsWC { hswc_ext = sig_wcs, hswc_body = ib_ty } <- sig_ty + | HsWC { hswc_ext = sig_wcs, hswc_body = ib_ty } <- sig_ty , HsIB { hsib_ext = implicit_hs_tvs , hsib_body = hs_ty } <- ib_ty , (explicit_hs_tvs, L _ hs_ctxt, hs_tau) <- splitLHsSigmaTy hs_ty @@ -2536,8 +2536,9 @@ tcHsPartialSigType _ (XHsWildCardBndrs _) = panic "tcHsPartialSigType" tcPartialContext :: HsContext GhcRn -> TcM (TcThetaType, Maybe TcType) tcPartialContext hs_theta | Just (hs_theta1, hs_ctxt_last) <- snocView hs_theta - , L _ wc@(HsWildCardTy _) <- ignoreParens hs_ctxt_last - = do { wc_tv_ty <- tcWildCardOcc wc constraintKind + , L wc_loc wc@(HsWildCardTy _) <- ignoreParens hs_ctxt_last + = do { wc_tv_ty <- setSrcSpan wc_loc $ + tcWildCardOcc wc constraintKind ; theta <- mapM tcLHsPredType hs_theta1 ; return (theta, Just wc_tv_ty) } | otherwise |