[GHC] #10495: Total inability to infer type for coerce

GHC ghc-devs at haskell.org
Fri Jun 5 20:44:36 UTC 2015


#10495: Total inability to infer type for coerce
-------------------------------------+-------------------------------------
              Reporter:  goldfire    |             Owner:  goldfire
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:
             Component:  Compiler    |           Version:  7.11
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 If I say

 {{{
 import Data.Coerce

 foo = coerce
 }}}

 I get

 {{{
     Couldn't match representation of type ‘a0’ with that of ‘b0’
       ‘a0’ is untouchable
         inside the constraints: ()
         bound by the inferred type of foo :: a0 -> b0
         at /Users/rae/temp/bug/App.hs:3:1-12
     Relevant bindings include
       foo :: a0 -> b0 (bound at /Users/rae/temp/bug/App.hs:3:1)
     In the expression: coerce
     In an equation for ‘foo’: foo = coerce
 }}}

 How awful. Eta-expanding `foo` works fine, though.

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


More information about the ghc-tickets mailing list