
#14967: Optimizer Casting Caf with nominal type -------------------------------------+------------------------------------- Reporter: etn | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.4.1 Resolution: invalid | Keywords: coerce, | nominal Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect result | Unknown/Multiple at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => invalid Comment: Looks ok to me. We get {{{ T14967.$fGenNom_$cgen :: forall a. Nom a T14967.$fGenNom_$cgen = \ (@ a_a2zl) -> trace @ (Nom a_a2zl) T14967.$fGenNom3 (T14967.$fGenNom1 @ a_a2zl) }}} and we invoke this polymorphic function at three different types. But types are erased before code generation, so this turns into {{{ T14967.$fGenNom_$cgen = trace T14967.$fGenNom3 T14967.$fGenNom1 }}} and the three uses of this thunk are of course shared. There no casting involved. Only polymorphic functions. Does that make sense? I'll close as not-a-bug but re-open if you disagree. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14967#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler