[GHC] #15232: TypeError is reported as "redundant constraint" starting with GHC 8.2
#15232: TypeError is reported as "redundant constraint" starting with GHC 8.2 -------------------------------------+------------------------------------- Reporter: fsoikin | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.3 Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple CustomTypeErrors | Architecture: | Type of failure: Incorrect Unknown/Multiple | error/warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- The following program compiles fine on GHC 8.0.2, but GHC 8.2.2 issues a warning, complaining that `TypeError` is a redundant constraint. This makes it very inconvenient to use `TypeError` with type classes. {{{#!hs {-# OPTIONS_GHC -Wredundant-constraints -Wall -Werror #-} import GHC.TypeLits (TypeError, ErrorMessage(..)) class C a where f :: a -> a instance {-# OVERLAPPING #-} C Int where f _ = 42 instance {-# OVERLAPPABLE #-} TypeError ( 'Text "Only Int is supported" ) => C a where f = undefined main :: IO () main = print $ f (42::Int) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15232> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15232: TypeError is reported as "redundant constraint" starting with GHC 8.2 -------------------------------------+------------------------------------- Reporter: fsoikin | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.3 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | CustomTypeErrors Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"5026840fddc86c3bc10693eed676fbf6a74f4227/ghc" 5026840f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="5026840fddc86c3bc10693eed676fbf6a74f4227" testsuite: Add test for #15232 Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15232 Differential Revision: https://phabricator.haskell.org/D4807 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15232#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15232: TypeError is reported as "redundant constraint" starting with GHC 8.2 -------------------------------------+------------------------------------- Reporter: fsoikin | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.2.3 Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | CustomTypeErrors Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"d66ca0111cefcda6620a4c82a932456b3e48874c/ghc" d66ca011/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="d66ca0111cefcda6620a4c82a932456b3e48874c" typecheck: Don't warn about "redundant" TypeError constraints Summary: This fixes #15232, where we would warn about `TypeError` constraints being redundant. Test Plan: Validate Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15232 Differential Revision: https://phabricator.haskell.org/D4808 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15232#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#15232: TypeError is reported as "redundant constraint" starting with GHC 8.2 -------------------------------------+------------------------------------- Reporter: fsoikin | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: | CustomTypeErrors Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple error/warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: 8.2.3 => 8.6.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15232#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC