[GHC] #15355: Functional dependencies can get GHC to print "UnkSkol"

#15355: Functional dependencies can get GHC to print "UnkSkol" -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Keywords: | Operating System: Unknown/Multiple FunctionalDependencies | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When I say {{{#!hs class C a b | a -> b where foo :: a -> b instance C Int Bool where foo = (>0) blah :: C Int Double => Int -> _a blah = foo }}} I get {{{ • Couldn't match type ‘Double’ with ‘Bool’ arising from a functional dependency between constraints: ‘C Int Bool’ arising from a use of ‘foo’ at Scratch.hs:51:8-10 ‘C Int Double’ arising from UnkSkol at Scratch.hs:51:1-10 • In the expression: foo In an equation for ‘blah’: blah = foo }}} There are actually two problems: 1. If we replace `_a` with `Double`, GHC accepts the program. I'm not sure it should. But that's a larger problem than... 2. ... when it prints the error, it says `UnkSkol`. It probably shouldn't. This ticket is about the second problem, because the first one require more fundep love than is usually on offer around here. Erroring here is reasonable enoug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15355 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15355: Functional dependencies can get GHC to print "UnkSkol" -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: | Keywords: | FunctionalDependencies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Re (1), see Trac #12466 for a long discussion, and `Note [Given errors]` in `TcErrors`. Bottom line, we suppress some Given errors, which represent unreachable code, as here. Re (2) HEAD seems better {{{ T15355.hs:12:8: error: * Couldn't match type `Double' with `Bool' arising from a functional dependency between constraints: `C Int _a' arising from a use of `foo' at T15355.hs:12:8-10 `C Int Double' arising from the type signature for: blah :: forall _a. C Int Double => Int -> _a at T15355.hs:11:1-33 * In the expression: foo In an equation for `blah': blah = foo | 12 | blah = foo | ^^^ }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15355#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15355: Functional dependencies can get GHC to print "UnkSkol" -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.3 Resolution: worksforme | Keywords: | FunctionalDependencies Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => closed * resolution: => worksforme Comment: I'm satisfied with that. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15355#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC