[commit: ghc] master: Comments only (2ab7f62)

git at git.haskell.org git at git.haskell.org
Thu Apr 6 11:34:35 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2ab7f626b94a5da4b544e01072219a95cd588202/ghc

>---------------------------------------------------------------

commit 2ab7f626b94a5da4b544e01072219a95cd588202
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Thu Apr 6 08:26:18 2017 +0100

    Comments only


>---------------------------------------------------------------

2ab7f626b94a5da4b544e01072219a95cd588202
 compiler/typecheck/TcExpr.hs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs
index 3bc6457..cbe94ea 100644
--- a/compiler/typecheck/TcExpr.hs
+++ b/compiler/typecheck/TcExpr.hs
@@ -607,6 +607,12 @@ tcExpr (HsProc pat cmd) res_ty
 
 -- Typechecks the static form and wraps it with a call to 'fromStaticPtr'.
 -- See Note [Grand plan for static forms] in StaticPtrTable for an overview.
+-- To type check
+--      (static e) :: p a
+-- we want to check (e :: a),
+-- and wrap (static e) in a call to
+--    fromStaticPtr :: IsStatic p => StaticPtr a -> p a
+
 tcExpr (HsStatic fvs expr) res_ty
   = do  { res_ty          <- expTypeToType res_ty
         ; (co, (p_ty, expr_ty)) <- matchExpectedAppTy res_ty
@@ -615,6 +621,7 @@ tcExpr (HsStatic fvs expr) res_ty
                              2 (ppr expr)
                        ) $
             tcPolyExprNC expr expr_ty
+
         -- Check that the free variables of the static form are closed.
         -- It's OK to use nonDetEltsUniqSet here as the only side effects of
         -- checkClosedInStaticForm are error messages.
@@ -628,6 +635,7 @@ tcExpr (HsStatic fvs expr) res_ty
         ; _ <- emitWantedEvVar StaticOrigin $
                   mkTyConApp (classTyCon typeableClass)
                              [liftedTypeKind, expr_ty]
+
         -- Insert the constraints of the static form in a global list for later
         -- validation.
         ; emitStaticConstraints lie



More information about the ghc-commits mailing list