
#12466: Typechecker regression: Inaccessible code in a type expected by the context -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.2 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: | -------------------------------------+------------------------------------- Comment (by mpickering): Ryan, I am very confused here. If I try the code from the ticket description, I can't call `foo @Char` so the defined instance is useless. Is this intentional? The same happens on GHC 8.0.1 and GHC 7.10.3. {{{ *Foo> :t foo @Char foo @Char :: (Char ~ Int => Int) -> Char -> Char *Foo> :t foo @Char 5 'a' <interactive>:1:1: error: • Couldn't match type ‘Char’ with ‘Int’ Inaccessible code in a type expected by the context: Char ~ Int => Int • In the second argument of ‘foo’, namely ‘5’ In the expression: foo @Char 5 'a' }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12466#comment:17 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler