summaryrefslogtreecommitdiff
path: root/testsuite/tests/gadt/T3651.stderr
Commit message (Collapse)AuthorAgeFilesLines
* Turn "inaccessible code" error into a warningTobias Dammers2018-06-021-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 Miedema2016-02-231-21/+21
|
* Modify a couple of error messages slightlySimon Peyton Jones2015-01-061-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 messagesHerbert Valerio Riedel2014-02-251-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 refactoringSimon Peyton Jones2013-04-221-35/+21
|
* Update outputs following the unicode quote change in GHC's outputIan Lynagh2013-02-241-13/+13
|
* Error message modifications following ghc-new-solver modificationsDimitrios.Vytiniotis2012-04-041-21/+35
|
* Error message modifications for the new constraint solver.Dimitrios Vytiniotis2011-11-161-21/+21
|
* Move tests from tests/ghc-regress/* to just tests/*David Terei2011-07-201-0/+21