diff options
author | Alan Zimmerman <alan.zimm@gmail.com> | 2017-11-22 21:28:58 +0200 |
---|---|---|
committer | Alan Zimmerman <alan.zimm@gmail.com> | 2017-11-22 21:28:58 +0200 |
commit | 468d7819ab0d7848c3c7910b40d0102efca43590 (patch) | |
tree | 3592272ddbf0954e493907373faea59807e61352 /compiler/typecheck/TcBinds.hs | |
parent | abdb5559b74af003a6d85f32695c034ff739f508 (diff) | |
download | haskell-468d7819ab0d7848c3c7910b40d0102efca43590.tar.gz |
Revert "Revert "trees that grow" work"
Continuing work on a long-running branch
This reverts commit 314bc31489f1f4cd69e913c3b1e33236b2bdf553.
Diffstat (limited to 'compiler/typecheck/TcBinds.hs')
-rw-r--r-- | compiler/typecheck/TcBinds.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 6a9b22a9bb..515eb4df35 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -308,13 +308,13 @@ tcCompleteSigs sigs = in mapMaybeM (addLocM doOne) sigs tcRecSelBinds :: HsValBinds GhcRn -> TcM TcGblEnv -tcRecSelBinds (ValBindsOut binds sigs) +tcRecSelBinds (XValBindsLR (NValBinds binds sigs)) = tcExtendGlobalValEnv [sel_id | L _ (IdSig sel_id) <- sigs] $ do { (rec_sel_binds, tcg_env) <- discardWarnings $ tcValBinds TopLevel binds sigs getGblEnv ; let tcg_env' = tcg_env `addTypecheckedBinds` map snd rec_sel_binds ; return tcg_env' } -tcRecSelBinds (ValBindsIn {}) = panic "tcRecSelBinds" +tcRecSelBinds (ValBinds {}) = panic "tcRecSelBinds" tcHsBootSigs :: [(RecFlag, LHsBinds GhcRn)] -> [LSig GhcRn] -> TcM [Id] -- A hs-boot file has only one BindGroup, and it only has type @@ -342,10 +342,10 @@ tcLocalBinds EmptyLocalBinds thing_inside = do { thing <- thing_inside ; return (EmptyLocalBinds, thing) } -tcLocalBinds (HsValBinds (ValBindsOut binds sigs)) thing_inside +tcLocalBinds (HsValBinds (XValBindsLR (NValBinds binds sigs))) thing_inside = do { (binds', thing) <- tcValBinds NotTopLevel binds sigs thing_inside - ; return (HsValBinds (ValBindsOut binds' sigs), thing) } -tcLocalBinds (HsValBinds (ValBindsIn {})) _ = panic "tcLocalBinds" + ; return (HsValBinds (XValBindsLR (NValBinds binds' sigs)), thing) } +tcLocalBinds (HsValBinds (ValBinds {})) _ = panic "tcLocalBinds" tcLocalBinds (HsIPBinds (IPBinds ip_binds _)) thing_inside = do { ipClass <- tcLookupClass ipClassName @@ -1178,9 +1178,9 @@ tcVect :: VectDecl GhcRn -> TcM (VectDecl GhcTcId) tcVect (HsVect s name rhs) = addErrCtxt (vectCtxt name) $ do { var <- wrapLocM tcLookupId name - ; let L rhs_loc (HsVar (L lv rhs_var_name)) = rhs + ; let L rhs_loc (HsVar noExt (L lv rhs_var_name)) = rhs ; rhs_id <- tcLookupId rhs_var_name - ; return $ HsVect s var (L rhs_loc (HsVar (L lv rhs_id))) + ; return $ HsVect s var (L rhs_loc (HsVar noExt (L lv rhs_id))) } tcVect (HsNoVect s name) @@ -1742,7 +1742,8 @@ isClosedBndrGroup type_env binds -- This one is called on LHS, when pat and grhss are both Name -- and on RHS, when pat is TcId and grhss is still Name -patMonoBindsCtxt :: (SourceTextX p, OutputableBndrId p, Outputable body) - => LPat p -> GRHSs GhcRn body -> SDoc +patMonoBindsCtxt :: (SourceTextX (GhcPass p), OutputableBndrId (GhcPass p), + Outputable body) + => LPat (GhcPass p) -> GRHSs GhcRn body -> SDoc patMonoBindsCtxt pat grhss = hang (text "In a pattern binding:") 2 (pprPatBind pat grhss) |