diff options
Diffstat (limited to 'compiler/GHC/Tc/TyCl')
-rw-r--r-- | compiler/GHC/Tc/TyCl/Instance.hs | 3 | ||||
-rw-r--r-- | compiler/GHC/Tc/TyCl/PatSyn.hs | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs index 65a2887049..699c50c54b 100644 --- a/compiler/GHC/Tc/TyCl/Instance.hs +++ b/compiler/GHC/Tc/TyCl/Instance.hs @@ -1951,8 +1951,9 @@ tcMethodBodyHelp hs_sig_fn sel_id local_meth_id meth_bind -- checking instance-sig <= class-meth-sig -- The instance-sig is the focus here; the class-meth-sig -- is fixed (#18036) + ; let orig = InstanceSigOrigin sel_name sig_ty local_meth_ty ; hs_wrap <- addErrCtxtM (methSigCtxt sel_name sig_ty local_meth_ty) $ - tcSubTypeSigma ctxt sig_ty local_meth_ty + tcSubTypeSigma orig ctxt sig_ty local_meth_ty ; return (sig_ty, hs_wrap) } ; inner_meth_name <- newName (nameOccName sel_name) diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs index 26ffe9116e..8091869187 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs @@ -316,7 +316,7 @@ and is not implicitly instantiated. So in mkProvEvidence we lift (a ~# b) to (a ~ b). Tiresome, and marginally less efficient, if the builder/martcher are not inlined. -See also Note [Lift equality constraints when quantifying] in GHC.Tc.Utils.TcType +See also Note [Lift equality constraints when quantifying] in GHC.Tc.Solver Note [Coercions that escape] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -474,7 +474,8 @@ tcCheckPatSynDecl psb@PSB{ psb_id = lname@(L _ name), psb_args = details -- Else the error message location is wherever tcCheckPat finished, -- namely the right-hand corner of the pattern do { arg_id <- tcLookupId arg_name - ; wrap <- tcSubTypeSigma GenSigCtxt + ; wrap <- tcSubTypeSigma (OccurrenceOf (idName arg_id)) + GenSigCtxt (idType arg_id) (substTy subst arg_ty) -- Why do we need tcSubType here? |