[GHC] #14618: Higher rank typechecking is broken

GHC ghc-devs at haskell.org
Tue Dec 26 18:42:37 UTC 2017


#14618: Higher rank typechecking is broken
-------------------------------------+-------------------------------------
        Reporter:  mniip             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:
       Component:  Compiler (Type    |              Version:  8.2.2
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC accepts       |  Unknown/Multiple
  invalid program                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 There is a core lint error at least..

 {{{
 [1 of 1] Compiling Foo              ( unco.hs, unco.o )
 *** Core Lint errors : in result of Desugar (after optimization) ***
 unco.hs:5:1: warning:
     [RHS of safeCoerce :: forall a b. a -> b]
     The type of this binder doesn't match the type of its RHS: safeCoerce
     Binder's type: forall a b. a -> b
     Rhs type: forall a b. b -> b
 *** Offending Program ***
 safeCoerce :: forall a b. a -> b
 [LclIdX]
 safeCoerce
   = \ (@ a_ao7) (@ b_ao8) ->
       let {
         f_anO :: forall d. d -> forall c. d
         [LclId]
         f_anO = \ (@ d_aop) (dk_aSV :: d_aop) (@ c_aos) -> dk_aSV } in
       \ (di_aSY :: b_ao8) -> f_anO @ b_ao8 di_aSY @ Any

 $trModule :: Module
 [LclIdX]
 $trModule = Module (TrNameS "main"#) (TrNameS "Foo"#)

 *** End of Offense ***


 <no location info>: error:
 Compilation had errors
 }}}

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


More information about the ghc-tickets mailing list