[GHC] #12694: GHC HEAD no longer reports inaccessible code

GHC ghc-devs at haskell.org
Fri Jul 27 20:57:50 UTC 2018


#12694: GHC HEAD no longer reports inaccessible code
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |             Keywords:
      Resolution:                    |  PatternMatchWarnings
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #12466, #11066,   |  Differential Rev(s):
  #13766                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by RyanGlScott):

 It seems that GHC 8.2 and later report this as inaccessible code again:

 {{{
 $ /opt/ghc/8.4.3/bin/ghc Bug.hs
 [1 of 1] Compiling A                ( Bug.hs, Bug.o )

 Bug.hs:4:7: error:
     • Could not deduce: a ~ b
       from the context: Bool ~ Int
         bound by the type signature for:
                    f :: forall a b. (Bool ~ Int) => a -> b
         at Bug.hs:3:1-25
       ‘a’ is a rigid type variable bound by
         the type signature for:
           f :: forall a b. (Bool ~ Int) => a -> b
         at Bug.hs:3:1-25
       ‘b’ is a rigid type variable bound by
         the type signature for:
           f :: forall a b. (Bool ~ Int) => a -> b
         at Bug.hs:3:1-25
     • In the expression: x
       In an equation for ‘f’: f x = x
     • Relevant bindings include
         x :: a (bound at Bug.hs:4:3)
         f :: a -> b (bound at Bug.hs:4:1)
   |
 4 | f x = x
   |       ^
 }}}

 Perhaps this can be closed, then?

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


More information about the ghc-tickets mailing list