[GHC] #12466: Typechecker regression: Inaccessible code in a type expected by the context

GHC ghc-devs at haskell.org
Fri Aug 5 21:35:55 UTC 2016


#12466: Typechecker regression: Inaccessible code in a type expected by the context
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  highest           |            Milestone:  8.2.1
       Component:  Compiler (Type    |              Version:  8.1
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by RyanGlScott:

@@ -1,1 +1,1 @@
- The following compiles with GHC 7.10.3 and earlier, but not with GHC HEAD:
+ The following compiles with GHC 8.0.1 and earlier, but not with GHC HEAD:

New description:

 The following compiles with GHC 8.0.1 and earlier, but not with GHC HEAD:

 {{{#!hs
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE TypeFamilies #-}
 module Bug where

 class Foo a where
   foo :: (a ~ Int => Int) -> a -> a
   foo _ a2 = a2

 instance Foo Char
 }}}

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

 Bug.hs:9:10: error:
     • Couldn't match type ‘Char’ with ‘Int’
       Inaccessible code in
         a type expected by the context:
           Char ~ Int => Int
     • In the expression: Bug.$dmfoo @Char
       In an equation for ‘foo’: foo = Bug.$dmfoo @Char
       In the instance declaration for ‘Foo Char’
 }}}

 This causes `lens-4.14` to [https://github.com/ekmett/lens/issues/667 fail
 to build] with GHC HEAD.

--

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


More information about the ghc-tickets mailing list