[GHC] #11396: deriving Ix with custom ifThenElse causes "Bad call to tagToEnum#"

GHC ghc-devs at haskell.org
Wed Jan 20 16:07:09 UTC 2016


#11396: deriving Ix with custom ifThenElse causes "Bad call to tagToEnum#"
-------------------------------------+-------------------------------------
        Reporter:  Lemming           |                Owner:  bgamari
            Type:  bug               |               Status:  patch
        Priority:  highest           |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  8.0.1-rc1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D1797
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"5cce09543db827e662539523ffff4513deb92777/ghc"
 5cce0954/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="5cce09543db827e662539523ffff4513deb92777"
 Use (&&) instead of `if` in Ix derivation

 We were previously using `if` in the derivation of `Ix` instances. This
 interacts badly with RebindableSyntax as the typechecker doesn't infer
 the type of the argument we give to `tagToEnum#`.

 Previously we produced, `if (ch >= ah) then (ch <= bh) else False`.

 We now produce `(ch >= ah) && (ch <= bh)`

 Fixes #11396.

 Test Plan: Validate

 Reviewers: austin, simonpj

 Reviewed By: simonpj

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D1797

 GHC Trac Issues: #11396
 }}}

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


More information about the ghc-tickets mailing list