[GHC] #14125: Bogus unacceptable type in foreign declaration.

GHC ghc-devs at haskell.org
Tue Aug 22 14:56:18 UTC 2017


#14125: Bogus unacceptable type in foreign declaration.
-------------------------------------+-------------------------------------
        Reporter:  winter            |                Owner:  (none)
            Type:  bug               |               Status:  patch
        Priority:  high              |            Milestone:  8.2.2
       Component:  Compiler (FFI)    |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3865
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"6982ee99fb97c252c3faf37faae34131fb66f67c/ghc"
 6982ee99/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="6982ee99fb97c252c3faf37faae34131fb66f67c"
 Fix #14125 by normalizing data family instances more aggressively

 Summary:
 Commit 3540d1e1a23926ce0a8a6ae83a36f5f6b2497ccf inadvertently broke
 the ability for newtype instances to be used as marshallable types in FFI
 declarations. The reason is a bit silly: an extra check was added for type
 synonyms with no type families on the RHS in `normalise_tc_app`, but this
 check
 would only skip over type families, not //data// families, since the
 predicate
 being used was `not . isTypeFamilyCon`.

 The fix is simple: just use `not . isFamilyCon` instead so that data
 families
 are also skipped by this check.

 Test Plan: make test TEST=T14125

 Reviewers: goldfire, simonpj, austin, bgamari

 Reviewed By: simonpj

 Subscribers: rwbarton, thomie

 GHC Trac Issues: #14125

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

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


More information about the ghc-tickets mailing list