Commit c973c70a authored by Simon Peyton Jones's avatar Simon Peyton Jones

Add a clarifying comment about scoping of type variables in associated type decls

parent 4690466d
......@@ -1307,6 +1307,11 @@ tcTyClTyVars tycon (HsQTvs { hsq_kvs = hs_kvs, hsq_tvs = hs_tvs }) thing_inside
; tvs <- zipWithM tc_hs_tv hs_tvs kinds
; tcExtendTyVarEnv tvs (thing_inside (kvs ++ tvs) res) }
-- In the case of associated types, the renamer has
-- ensured that the names are in commmon
-- e.g. class C a_29 where
-- type T b_30 a_29 :: *
-- Here the a_29 is shared
tc_hs_tv (L _ (UserTyVar n)) kind = return (mkTyVar n kind)
tc_hs_tv (L _ (KindedTyVar n hs_k)) kind = do { tc_kind <- tcLHsKind hs_k
; checkKind kind tc_kind
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment