[GHC] #11066: Inacessible branch should be warning - otherwise breaks type soundness?

GHC ghc-devs at haskell.org
Sun May 13 21:22:29 UTC 2018


#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):

 Turning the error into a warning causes a few regressions, e.g. T3651:

 {{{
 {-# LANGUAGE GADTs #-}
 {-# LANGUAGE TypeFamilies #-}

 module T3651 where

 data Z a where
   U :: Z ()
   B :: Z Bool

 unsafe1 :: Z a -> Z a -> a
 unsafe1 B U = ()

 unsafe2 :: a ~ b => Z b -> Z a -> a
 unsafe2 B U = ()

 unsafe3 :: a ~ b => Z a -> Z b -> a
 unsafe3 B U = True
 }}}

 This program previously failed with this exact error, and of course
 changing it into a warning makes it compile.

 Other regressions are:

 - {{{concurrent/prog001/concprog001.run          concprog001 [bad exit
 code] (threaded2)}}}
 - {{{gadt/T3651.run                              T3651 [stderr mismatch]
 (normal)}}}
 - {{{gadt/T7293.run                              T7293 [exit code 0]
 (normal)}}}
 - {{{gadt/T7294.run                              T7294 [stderr mismatch]
 (normal)}}}
 - {{{gadt/T7558.run                              T7558 [stderr mismatch]
 (normal)}}}
 - {{{ghci/scripts/Defer02.run                    Defer02 [bad stderr]
 (ghci)}}}
 - {{{typecheck/should_fail/tcfail167.run         tcfail167 [exit code 0]
 (normal)}}}
 - {{{typecheck/should_fail/FrozenErrorTests.run  FrozenErrorTests [stderr
 mismatch] (normal)}}}
 - {{{typecheck/should_run/Typeable1.run          Typeable1 [exit code 0]
 (normal)}}}

 I will look into these, but I suspect that most of them are exactly what
 we'd expect.

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


More information about the ghc-tickets mailing list