
#13614: Rewrite rules not applied exhaustively when simplifying from plugin -------------------------------------+------------------------------------- Reporter: nomeata | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHC API | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Ah now I get it
As far as I can tell, the rule foo1 and foo2 are attached to all occurrences of foo in the module – excluding the ones on the RHS of the rules themselves!
That should not matter: at every occurrence of a variable it is looked up in the in-scope set, to get the "master copy", so after simplification all occurrences point to the binder. This is done by `SimplEnv.substId`. There is a debug WARN if the `Id` is not in the in-scope set. But I bet you have a non-debug compiler; and that you have an in-scope set that does not include `foo`. Might that be it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13614#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler