[commit: ghc] master: Comments only, on the invariants of GlobalRdrEnv (6036cb6)

git at git.haskell.org git at git.haskell.org
Mon Feb 8 15:07:32 UTC 2016


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6036cb6f67892e445bb3150850365dc7c7d64a40/ghc

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

commit 6036cb6f67892e445bb3150850365dc7c7d64a40
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Feb 1 14:01:34 2016 +0000

    Comments only, on the invariants of GlobalRdrEnv


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

6036cb6f67892e445bb3150850365dc7c7d64a40
 compiler/basicTypes/RdrName.hs | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs
index 62771e9..62f473e 100644
--- a/compiler/basicTypes/RdrName.hs
+++ b/compiler/basicTypes/RdrName.hs
@@ -416,6 +416,13 @@ type GlobalRdrEnv = OccEnv [GlobalRdrElt]
 --              happens only when type-checking a [d| ... |] Template
 --              Haskell quotation; see this note in RnNames
 --              Note [Top-level Names in Template Haskell decl quotes]
+--
+-- INVARIANT 3: If the GlobalRdrEnv maps [occ -> gre], then
+--                 greOccName gre = occ
+--
+--              NB: greOccName gre is usually the same as
+--                  nameOccName (gre_name gre), but not always in the
+--                  case of record seectors; see greOccName
 
 -- | An element of the 'GlobalRdrEnv'
 data GlobalRdrElt



More information about the ghc-commits mailing list