[GHC] #13658: Assertion failure on HEAD: "optCoercion changed types!"

GHC ghc-devs at haskell.org
Tue May 9 02:26:55 UTC 2017


#13658: Assertion failure on HEAD: "optCoercion changed types!"
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  high              |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.3
      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:D3545
       Wiki Page:                    |
-------------------------------------+-------------------------------------

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

 In [changeset:"87ff5d4f0f812bad118600df0156f980b91191c5/ghc"
 87ff5d4f/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="87ff5d4f0f812bad118600df0156f980b91191c5"
 OptCoercion: Ensure that TyConApps match in arity

 Previously OptCoercion would potentially change the type of UnivCo
 coercions of the shape,
 ```
 co :: TyCon arg1 ... argN ~ TyCon arg1' ... argN'
 ```
 where the arities of the left and right applications differ. In this
 case we
 would try to zip the two argument lists, meaning that one would get
 truncated.

 One would think this could never happen since it implies we are
 applying the
 same TyCon to two different numbers of arguments. However, it does
 arise in the
 case of applications of the `Any` tycon, which arises from the
 typechecker (in
 `Data.Typeable.Internal`) where we end up with an `UnsafeCo`,
 ```
 co :: Any (Any -> Any) Any ~ Any (Any -> Any)
 ```

 Test Plan: Validate

 Reviewers: simonpj, austin, goldfire

 Reviewed By: simonpj

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #13658

 Differential Revision: https://phabricator.haskell.org/D3545
 }}}

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


More information about the ghc-tickets mailing list