summaryrefslogtreecommitdiff
path: root/compiler/rename
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rename')
-rw-r--r--compiler/rename/RnSource.hs9
-rw-r--r--compiler/rename/RnTypes.hs7
2 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rename/RnSource.hs b/compiler/rename/RnSource.hs
index 447871a7f2..53feacb8df 100644
--- a/compiler/rename/RnSource.hs
+++ b/compiler/rename/RnSource.hs
@@ -634,7 +634,8 @@ rnClsInstDecl (ClsInstDecl { cid_poly_ty = inst_ty, cid_binds = mbinds
, cid_sigs = uprags, cid_tyfam_insts = ats
, cid_overlap_mode = oflag
, cid_datafam_insts = adts })
- = do { (inst_ty', inst_fvs) <- rnLHsInstType (text "an instance declaration") inst_ty
+ = do { let ctxt = GenericCtx (text "an instance declaration")
+ ; (inst_ty', inst_fvs) <- rnHsSigType ctxt inst_ty
; let (ktv_names, _, head_ty') = splitLHsInstDeclTy inst_ty'
; let cls = case hsTyGetAppHead_maybe head_ty' of
Nothing -> mkUnboundName (mkTcOccFS (fsLit "<class>"))
@@ -945,7 +946,8 @@ rnSrcDerivDecl (DerivDecl ty deriv_strat overlap)
; unless standalone_deriv_ok (addErr standaloneDerivErr)
; failIfTc (isJust deriv_strat && not deriv_strats_ok) $
illegalDerivStrategyErr $ fmap unLoc deriv_strat
- ; (ty', fvs) <- rnLHsInstType (text "a deriving declaration") ty
+ ; let ctxt = GenericCtx (text "a deriving declaration")
+ ; (ty', fvs) <- rnHsSigWcType ctxt ty
; return (DerivDecl ty' deriv_strat overlap, fvs) }
standaloneDerivErr :: SDoc
@@ -1124,7 +1126,8 @@ rnHsVectDecl (HsVectClassIn s cls)
rnHsVectDecl (HsVectClassOut _)
= panic "RnSource.rnHsVectDecl: Unexpected 'HsVectClassOut'"
rnHsVectDecl (HsVectInstIn instTy)
- = do { (instTy', fvs) <- rnLHsInstType (text "a VECTORISE pragma") instTy
+ = do { let ctxt = GenericCtx (text "a VECTORISE pragma")
+ ; (instTy', fvs) <- rnHsSigType ctxt instTy
; return (HsVectInstIn instTy', fvs)
}
rnHsVectDecl (HsVectInstOut _)
diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs
index b2dafb2bf7..791881bbd0 100644
--- a/compiler/rename/RnTypes.hs
+++ b/compiler/rename/RnTypes.hs
@@ -13,7 +13,6 @@ module RnTypes (
rnHsKind, rnLHsKind,
rnHsSigType, rnHsWcType,
rnHsSigWcType, rnHsSigWcTypeScoped,
- rnLHsInstType,
newTyVarNameRn, collectAnonWildCards,
rnConDeclFields,
rnLTyVar,
@@ -323,12 +322,6 @@ rnImplicitBndrs bind_free_tvs doc
; bindLocalNamesFV vars $
thing_inside vars }
-rnLHsInstType :: SDoc -> LHsSigType GhcPs -> RnM (LHsSigType GhcRn, FreeVars)
--- Rename the type in an instance or standalone deriving decl
--- The 'doc_str' is "an instance declaration" or "a VECTORISE pragma"
--- Do not try to decompose the inst_ty in case it is malformed
-rnLHsInstType doc inst_ty = rnHsSigType (GenericCtx doc) inst_ty
-
mk_implicit_bndrs :: [Name] -- implicitly bound
-> a -- payload
-> FreeVars -- FreeVars of payload