[GHC] #10076: Don't suppress warnings in the presence of errors

#10076: Don't suppress warnings in the presence of errors -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.11 Component: Compiler | Operating System: Unknown/Multiple Keywords: | Type of failure: Incorrect Architecture: | warning at compile-time Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Consider this fragment of code (uses injective type families, not yet merged into HEAD): {{{#!hs type family Bar a = r | r -> a where Bar Int = Bool Bar Bool = Int Bar Bool = Char bar :: Bar a -> Bar a bar x = x barapp :: Char barapp = bar 'c' }}} GHC rejects this with an error: {{{ Couldn't match expected type ‘Bar a0’ with actual type ‘Char’ The type variable ‘a0’ is ambiguous In the first argument of ‘bar’, namely ‘'c'’ In the expression: bar 'c' In an equation for ‘barapp’: barapp = bar 'c' }}} The reason why this is rejected is that the last type family equation is not reachable. GHC warns about that if I comment out `barapp`: {{{ Dropping overlapped type family instance equation: Bar Bool = Char }}} I believe that with that warning source of the error would be easier to find. So I propose that by default GHC does not suppress warnings in the presence of errors. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10076 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10076: Don't suppress warnings in the presence of errors -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by rwbarton): This (displaying warnings also when there are errors) is the topic of at least one other Trac ticket, though I'm too lazy to look for it right now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10076#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10076: Don't suppress warnings in the presence of errors -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by goldfire): For another motivating example, see #10106. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10076#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC