Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Turn "inaccessible code" error into a warning | Tobias Dammers | 2018-06-02 | 1 | -17/+10 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With GADTs, it is possible to write programs such that the type constraints make some code branches inaccessible. Take, for example, the following program :: {-# LANGUAGE GADTs #-} data Foo a where Foo1 :: Foo Char Foo2 :: Foo Int data TyEquality a b where Refl :: TyEquality a a checkTEQ :: Foo t -> Foo u -> Maybe (TyEquality t u) checkTEQ x y = error "unimportant" step2 :: Bool step2 = case checkTEQ Foo1 Foo2 of Just Refl -> True -- Inaccessible code Nothing -> False Clearly, the `Just Refl` case cannot ever be reached, because the `Foo1` and `Foo2` constructors say `t ~ Char` and `u ~ Int`, while the `Refl` constructor essentially mandates `t ~ u`, and thus `Char ~ Int`. Previously, GHC would reject such programs entirely; however, in practice this is too harsh. Accepting such code does little harm, since attempting to use the "impossible" code will still produce errors down the chain, while rejecting it means we cannot legally write or generate such code at all. Hence, we turn the error into a warning, and provide `-Winaccessible-code` to control GHC's behavior upon encountering this situation. Test Plan: ./validate Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #11066 Differential Revision: https://phabricator.haskell.org/D4744 | ||||
* | Testsuite: accept output without Windows line endings (#11631) | Thomas Miedema | 2016-02-23 | 1 | -21/+21 |
| | |||||
* | Modify a couple of error messages slightly | Simon Peyton Jones | 2015-01-06 | 1 | -3/+3 |
| | | | | | | | | | | | | In particular In the type signature for: f :: Int -> Int I added the colon Also reword the "maybe you haven't applied a function to enough arguments?" suggestion to make grammatical sense. These tiny changes affect a lot of error messages. | ||||
* | Use U+2018 instead of U+201B quote mark in compiler messages | Herbert Valerio Riedel | 2014-02-25 | 1 | -9/+9 |
| | | | | | | | This matches GCC's choice of Unicode quotation marks (i.e. U+2018 and U+2019) and therefore looks more familiar on the console. This addresses #2507. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org> | ||||
* | Error message wibbles, following TcErrors refactoring | Simon Peyton Jones | 2013-04-22 | 1 | -35/+21 |
| | |||||
* | Update outputs following the unicode quote change in GHC's output | Ian Lynagh | 2013-02-24 | 1 | -13/+13 |
| | |||||
* | Error message modifications following ghc-new-solver modifications | Dimitrios.Vytiniotis | 2012-04-04 | 1 | -21/+35 |
| | |||||
* | Error message modifications for the new constraint solver. | Dimitrios Vytiniotis | 2011-11-16 | 1 | -21/+21 |
| | |||||
* | Move tests from tests/ghc-regress/* to just tests/* | David Terei | 2011-07-20 | 1 | -0/+21 |