
#12161: Panic when literal is coerced into function -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: lowest | Milestone: ⊥ Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #2864 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): You definitely can't coerce an unboxed `Int#` into a polymorphic type variable `a`. See [http://hackage.haskell.org/package/ghc- prim-0.5.0.0/docs/GHC-Prim.html#v:unsafeCoerce-35- the rules for unsafeCoerce]. Still, it really should not make GHC crash outright. If someone wants to dig in and fix, I can advise. But given that the program is so wrong, it doesn't seem that important. Mind you, it'd be good if Core Lint checked those rules for `unsafeCoerce`.... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12161#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler