[GHC] #10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template variable unbound in rewrite rule'

GHC ghc-devs at haskell.org
Thu Jul 30 10:02:07 UTC 2015


#10689: compiling singletons-1.1.2.1 as -O1 -fspec-constr fails as 'Template
variable unbound in rewrite rule'
-------------------------------------+-------------------------------------
        Reporter:  slyfox            |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  high              |               Milestone:  7.10.3
       Component:  Compiler          |                 Version:  7.10.2-rc2
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by Simon Peyton Jones <simonpj@…>):

 In [changeset:"4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb/ghc" 4e8d74d/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="4e8d74d2362fbb025614ddeedfa3a9202bb6f2bb"
 Deal with phantom type variables in rules

 See Note [Unbound template type variables] in Rules.hs
 This fixes Trac #10689.

 The problem was a rule LHS that mentioned a type variable
 in a phantom argument to a type synonym.  Then matching the
 LHS didn't bind the type variable, and the rule matcher
 complained.

 This patch fixes the problem, as described by the Note.

 I also went back to not-cloning the template varaibles during
 rule matching.  I'm convinced that it's not necessary now
 (if it ever was), and cloning makes the fix for #10689 much more
 fiddly.
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10689#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list