Make the matcher and wrapper Ids in PatSyn into LocalIds, not GlobalIds
This was a serious bug, exposed by Trac #9175. The matcher and wrapper must be LocalIds, like record selectors and dictionary functions, for the reasons now documented in Note [Exported LocalIds] in Id.lhs In fixing this I found - PatSyn should have an Id inside it (apart from the wrapper and matcher) It should be a Name. Hence psId --> psName, with knock-on consequences - Tidying of PatSyns in TidyPgm was wrong - The keep-alive set in Desugar.deSugar (now) doesn't need pattern synonyms in it I also cleaned up the interface to PatSyn a little, so there's a tiny knock-on effect in Haddock; hence the haddock submodule update. It's very hard to make a test for this bug, so I haven't. (cherry picked from commit 7ac600d5) Conflicts: utils/haddock
Showing
- compiler/basicTypes/Id.lhs 37 additions, 2 deletionscompiler/basicTypes/Id.lhs
- compiler/basicTypes/MkId.lhs 7 additions, 24 deletionscompiler/basicTypes/MkId.lhs
- compiler/basicTypes/PatSyn.lhs 47 additions, 32 deletionscompiler/basicTypes/PatSyn.lhs
- compiler/deSugar/Desugar.lhs 6 additions, 15 deletionscompiler/deSugar/Desugar.lhs
- compiler/deSugar/MatchCon.lhs 1 addition, 1 deletioncompiler/deSugar/MatchCon.lhs
- compiler/hsSyn/Convert.lhs 1 addition, 1 deletioncompiler/hsSyn/Convert.lhs
- compiler/iface/MkIface.lhs 1 addition, 3 deletionscompiler/iface/MkIface.lhs
- compiler/main/HscTypes.lhs 5 additions, 15 deletionscompiler/main/HscTypes.lhs
- compiler/main/TidyPgm.lhs 30 additions, 22 deletionscompiler/main/TidyPgm.lhs
- compiler/typecheck/TcEnv.lhs 2 additions, 1 deletioncompiler/typecheck/TcEnv.lhs
- compiler/typecheck/TcPat.lhs 1 addition, 3 deletionscompiler/typecheck/TcPat.lhs
- compiler/typecheck/TcPatSyn.lhs 3 additions, 2 deletionscompiler/typecheck/TcPatSyn.lhs
- compiler/typecheck/TcRnDriver.lhs 3 additions, 2 deletionscompiler/typecheck/TcRnDriver.lhs
- compiler/typecheck/TcRnTypes.lhs 2 additions, 2 deletionscompiler/typecheck/TcRnTypes.lhs
- compiler/typecheck/TcSplice.lhs 2 additions, 2 deletionscompiler/typecheck/TcSplice.lhs
- compiler/typecheck/TcTyClsDecls.lhs 3 additions, 4 deletionscompiler/typecheck/TcTyClsDecls.lhs
- compiler/vectorise/Vectorise/Monad/Naming.hs 4 additions, 3 deletionscompiler/vectorise/Vectorise/Monad/Naming.hs
Loading
Please register or sign in to comment