[Git][ghc/ghc][master] Delete outdated Note [Kind-checking tyvar binders for associated types]

Marge Bot gitlab at gitlab.haskell.org
Sat Dec 12 03:39:32 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
5feb9b2d by Ryan Scott at 2020-12-11T22:39:29-05:00
Delete outdated Note [Kind-checking tyvar binders for associated types]

This Note has severely bitrotted, as it has no references anywhere in the
codebase, and none of the functions that it mentions exist anymore. Let's just
delete this. While I was in town, I deleted some outdated comments from
`checkFamPatBinders` of a similar caliber.

Fixes #19008.

[ci skip]

- - - - -


2 changed files:

- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Validity.hs


Changes:

=====================================
compiler/GHC/Tc/Gen/HsType.hs
=====================================
@@ -2819,24 +2819,6 @@ But notice that (#16322 comment:3)
   although T3 is really polymorphic-recursive too.
   Perhaps we should somehow reject that.
 
-Note [Kind-checking tyvar binders for associated types]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-When kind-checking the type-variable binders for associated
-   data/newtype decls
-   family decls
-we behave specially for type variables that are already in scope;
-that is, bound by the enclosing class decl.  This is done in
-kcLHsQTyVarBndrs:
-  * The use of tcImplicitQTKBndrs
-  * The tcLookupLocal_maybe code in kc_hs_tv
-
-See Note [Associated type tyvar names] in GHC.Core.Class and
-    Note [TyVar binders for associated decls] in GHC.Hs.Decls
-
-We must do the same for family instance decls, where the in-scope
-variables may be bound by the enclosing class instance decl.
-Hence the use of tcImplicitQTKBndrs in tcFamTyPatsAndGen.
-
 Note [Kind variable ordering for associated types]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 What should be the kind of `T` in the following example? (#15591)


=====================================
compiler/GHC/Tc/Validity.hs
=====================================
@@ -2263,12 +2263,6 @@ checkFamPatBinders :: TyCon
                    -> [TcType]    -- LHS patterns
                    -> Type        -- RHS
                    -> TcM ()
--- We do these binder checks now, in tcFamTyPatsAndGen, rather
--- than later, in checkValidFamEqn, for two reasons:
---   - We have the implicitly and explicitly
---     bound type variables conveniently to hand
---   - If implicit variables are out of scope it may
---     cause a crash; notably in tcConDecl in tcDataFamInstDecl
 checkFamPatBinders fam_tc qtvs pats rhs
   = do { traceTc "checkFamPatBinders" $
          vcat [ debugPprType (mkTyConApp fam_tc pats)



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5feb9b2dad0ce609e3cfb537a6ca758a09a6898e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5feb9b2dad0ce609e3cfb537a6ca758a09a6898e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201211/2731a0f3/attachment-0001.html>


More information about the ghc-commits mailing list