
#11066: Inacessible branch should be warning - otherwise breaks type soundness? -------------------------------------+------------------------------------- Reporter: rrnewton | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.6.1 Component: Compiler | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #8128, #8740 | Differential Rev(s): Phab:D1454 Wiki Page: | -------------------------------------+------------------------------------- Comment (by tdammers): Replying to [comment:45 simonpj]:
But that doesn't seem right.
It seems fine to me, arguably. The equality `a~b` is not needed; running `unsafe3` will never seg-fault.
Right, of course... it's nonsensical code, but it won't blow up. I just found it peculiar that the "Inaccessible code" warning doesn't fire at all anymore.
BTW, if it's now a warning do we have a flag to control whether the warning is enabled? We should.
Not yet, but I was going to add one. Just didn't want to put in that effort while it was still unclear whether we go through with this. I would suggest that we turn it on by default though; it's generally a useful warning to have, and disabling it is probably something you'd only want to do when you know what you're doing. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11066#comment:46 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler