diff options
Diffstat (limited to 'testsuite/tests/rename/should_fail')
39 files changed, 180 insertions, 66 deletions
diff --git a/testsuite/tests/rename/should_fail/T10618.hs b/testsuite/tests/rename/should_fail/T10618.hs index 28b665f6fb..d69cf3d409 100644 --- a/testsuite/tests/rename/should_fail/T10618.hs +++ b/testsuite/tests/rename/should_fail/T10618.hs @@ -1,3 +1,3 @@ module T10618 where -foo = Just $ Nothing <> Nothing +foo = Just $ Nothing <|> Nothing diff --git a/testsuite/tests/rename/should_fail/T10618.stderr b/testsuite/tests/rename/should_fail/T10618.stderr index 8b4dc2c28d..2d478744e1 100644 --- a/testsuite/tests/rename/should_fail/T10618.stderr +++ b/testsuite/tests/rename/should_fail/T10618.stderr @@ -1,6 +1,6 @@ T10618.hs:3:22: error: - • Variable not in scope: (<>) :: Maybe (Maybe a0) -> Maybe a1 -> t + • Variable not in scope: (<|>) :: Maybe (Maybe a0) -> Maybe a1 -> t • Perhaps you meant one of these: - ‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude), - ‘<$’ (imported from Prelude) + ‘<$>’ (imported from Prelude), ‘<*>’ (imported from Prelude), + ‘<>’ (imported from Prelude) diff --git a/testsuite/tests/rename/should_fail/T11592.hs b/testsuite/tests/rename/should_fail/T11592.hs index b963cdf8ba..53714f1a68 100644 --- a/testsuite/tests/rename/should_fail/T11592.hs +++ b/testsuite/tests/rename/should_fail/T11592.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TypeInType #-} +{-# LANGUAGE PolyKinds #-} module Bug11592 where diff --git a/testsuite/tests/rename/should_fail/T11592.stderr b/testsuite/tests/rename/should_fail/T11592.stderr index bffea1cca7..9adac1549b 100644 --- a/testsuite/tests/rename/should_fail/T11592.stderr +++ b/testsuite/tests/rename/should_fail/T11592.stderr @@ -1,19 +1,8 @@ -T11592.hs:5:9: - Variable ‘a’ is used in the kind signature of its - declaration as a type variable. - the data type declaration for ‘A’ -T11592.hs:7:11: - Variable ‘a’ is used in the kind signature of its - declaration as a type variable. - the data type declaration for ‘B’ +T11592.hs:5:14: error: Not in scope: type variable ‘a’ -T11592.hs:8:11: - Variable ‘a’ is used in the kind signature of its - declaration as a type variable. - the data type declaration for ‘C’ +T11592.hs:7:16: error: Not in scope: type variable ‘a’ -T11592.hs:10:13: - Variable ‘a’ is used in the kind signature of its - declaration as a type variable. - the data type declaration for ‘D’ +T11592.hs:8:18: error: Not in scope: type variable ‘a’ + +T11592.hs:10:20: error: Not in scope: type variable ‘a’ diff --git a/testsuite/tests/rename/should_fail/T12146.hs b/testsuite/tests/rename/should_fail/T12146.hs new file mode 100644 index 0000000000..e44be13f04 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T12146.hs @@ -0,0 +1,5 @@ +-- Test Trac #12146 + +module T12146 where + +ipmort Data.Char diff --git a/testsuite/tests/rename/should_fail/T12146.stderr b/testsuite/tests/rename/should_fail/T12146.stderr new file mode 100644 index 0000000000..0dcd15470d --- /dev/null +++ b/testsuite/tests/rename/should_fail/T12146.stderr @@ -0,0 +1,4 @@ + +T12146.hs:5:1: + Parse error: module header, import declaration + or top-level declaration expected. diff --git a/testsuite/tests/rename/should_fail/T13847.hs b/testsuite/tests/rename/should_fail/T13847.hs new file mode 100644 index 0000000000..09c67de54f --- /dev/null +++ b/testsuite/tests/rename/should_fail/T13847.hs @@ -0,0 +1,4 @@ +module Main where +import qualified T13847A as A +foo = "foo" +main = print $ A.foo $ A.A { foo = () } diff --git a/testsuite/tests/rename/should_fail/T13847.stderr b/testsuite/tests/rename/should_fail/T13847.stderr new file mode 100644 index 0000000000..52edbf5acf --- /dev/null +++ b/testsuite/tests/rename/should_fail/T13847.stderr @@ -0,0 +1,6 @@ + +T13847.hs:4:24: error: + • Constructor ‘A.A’ does not have field ‘foo’ + • In the second argument of ‘($)’, namely ‘A.A {foo = ()}’ + In the second argument of ‘($)’, namely ‘A.foo $ A.A {foo = ()}’ + In the expression: print $ A.foo $ A.A {foo = ()} diff --git a/testsuite/tests/rename/should_fail/T13847A.hs b/testsuite/tests/rename/should_fail/T13847A.hs new file mode 100644 index 0000000000..e3e54a8f18 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T13847A.hs @@ -0,0 +1,2 @@ +module T13847A where +data A = A { foo :: () } diff --git a/testsuite/tests/rename/should_fail/T13947.stderr b/testsuite/tests/rename/should_fail/T13947.stderr index 8a636a2bb9..8533f9f743 100644 --- a/testsuite/tests/rename/should_fail/T13947.stderr +++ b/testsuite/tests/rename/should_fail/T13947.stderr @@ -1,3 +1,3 @@ -T13947.hs:4:12: error: +T13947.hs:4:16: error: Not in scope: type constructor or class ‘:~:’ diff --git a/testsuite/tests/rename/should_fail/T14307.hs b/testsuite/tests/rename/should_fail/T14307.hs new file mode 100644 index 0000000000..9bb33b7425 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14307.hs @@ -0,0 +1,10 @@ +{-# LANGUAGE DuplicateRecordFields #-} +{-# LANGUAGE NamedFieldPuns #-} + +module T14307 where + +data A = A { field :: Int } +data B = B { field :: Int } + +f :: B -> Int +f (C { field }) = field diff --git a/testsuite/tests/rename/should_fail/T14307.stderr b/testsuite/tests/rename/should_fail/T14307.stderr new file mode 100644 index 0000000000..1470a406d4 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14307.stderr @@ -0,0 +1,2 @@ + +T14307.hs:10:4: error: Not in scope: data constructor ‘C’ diff --git a/testsuite/tests/rename/should_fail/T14591.hs b/testsuite/tests/rename/should_fail/T14591.hs new file mode 100644 index 0000000000..44313427fb --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14591.hs @@ -0,0 +1,12 @@ +-- Checks that the ordering constraint on the groupWith function is respected +{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-} + +module T14591 where + +import GHC.Exts (groupWith) + +data Unorderable = Gnorf | Pinky | Brain +foo = [ () + | Gnorf <- [Gnorf, Brain] + , then group by x using groupWith + ] diff --git a/testsuite/tests/rename/should_fail/T14591.stderr b/testsuite/tests/rename/should_fail/T14591.stderr new file mode 100644 index 0000000000..47e4df0d55 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T14591.stderr @@ -0,0 +1,2 @@ + +T14591.hs:11:23: error: Variable not in scope: x diff --git a/testsuite/tests/rename/should_fail/T15214.hs b/testsuite/tests/rename/should_fail/T15214.hs new file mode 100644 index 0000000000..55f15593be --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15214.hs @@ -0,0 +1,4 @@ +{-# LANGUAGE TypeOperators #-} +module T15214 where + +type (~) = Either diff --git a/testsuite/tests/rename/should_fail/T15214.stderr b/testsuite/tests/rename/should_fail/T15214.stderr new file mode 100644 index 0000000000..399438adb5 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15214.stderr @@ -0,0 +1,2 @@ + +T15214.hs:4:1: error: Illegal binding of built-in syntax: ~ diff --git a/testsuite/tests/rename/should_fail/T15487.hs b/testsuite/tests/rename/should_fail/T15487.hs new file mode 100644 index 0000000000..62e69e3805 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15487.hs @@ -0,0 +1,7 @@ +module T15487 where + +import qualified T15487a + +null = 42 + +foo x = null diff --git a/testsuite/tests/rename/should_fail/T15487.stderr b/testsuite/tests/rename/should_fail/T15487.stderr new file mode 100644 index 0000000000..bb25939f4b --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15487.stderr @@ -0,0 +1,8 @@ + +T15487.hs:7:9: error: + Ambiguous occurrence ‘null’ + It could refer to + either ‘Prelude.null’, + imported from ‘Prelude’ at T15487.hs:1:8-13 + (and originally defined in ‘Data.Foldable’) + or ‘T15487.null’, defined at T15487.hs:5:1 diff --git a/testsuite/tests/rename/should_fail/T15487a.hs b/testsuite/tests/rename/should_fail/T15487a.hs new file mode 100644 index 0000000000..e8687eee44 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15487a.hs @@ -0,0 +1 @@ +module T15487a (null) where diff --git a/testsuite/tests/rename/should_fail/T15539.hs b/testsuite/tests/rename/should_fail/T15539.hs new file mode 100644 index 0000000000..d1b5a37e7b --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15539.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE RankNTypes #-} +module T15539 where + +foo :: String +foo = show a + where a = baz + +-- We get top level constraints +-- Show a +-- forall . <not in scope baz> +-- We want the insoluble non-in-scope error to suppress +-- the Show a, just as it does if the whole things is nested + +bar :: Int +bar = 1 + +bam = putStrLn foo diff --git a/testsuite/tests/rename/should_fail/T15539.stderr b/testsuite/tests/rename/should_fail/T15539.stderr new file mode 100644 index 0000000000..c3de7780d4 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15539.stderr @@ -0,0 +1,4 @@ + +T15539.hs:6:13: error: + • Variable not in scope: baz + • Perhaps you meant one of these: ‘bar’ (line 15), ‘bam’ (line 17) diff --git a/testsuite/tests/rename/should_fail/T15607.hs b/testsuite/tests/rename/should_fail/T15607.hs new file mode 100644 index 0000000000..a692ca5580 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15607.hs @@ -0,0 +1,6 @@ +{-# LANGUAGE RebindableSyntax #-}
+module T15607 where
+
+import Prelude hiding (pure, return)
+
+t = do { pure 5 }
diff --git a/testsuite/tests/rename/should_fail/T15607.stderr b/testsuite/tests/rename/should_fail/T15607.stderr new file mode 100644 index 0000000000..9bc84f42f7 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15607.stderr @@ -0,0 +1,5 @@ + +T15607.hs:6:10: error: + • Variable not in scope: pure :: Integer -> t + • Perhaps you want to remove ‘pure’ from the explicit hiding list + in the import of ‘Prelude’ (T15607.hs:4:1-36). diff --git a/testsuite/tests/rename/should_fail/T15659.hs b/testsuite/tests/rename/should_fail/T15659.hs new file mode 100644 index 0000000000..9fa516f2b6 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15659.hs @@ -0,0 +1,5 @@ +module T15659 where + +{-# RULES "test" forall x. f x = x #-} + + diff --git a/testsuite/tests/rename/should_fail/T15659.stderr b/testsuite/tests/rename/should_fail/T15659.stderr new file mode 100644 index 0000000000..e1cbf9f079 --- /dev/null +++ b/testsuite/tests/rename/should_fail/T15659.stderr @@ -0,0 +1,6 @@ + +T15659.hs:3:11: error: + Rule "test": + Not in scope: ‘f’ + in left-hand side: f x + LHS must be of form (f e1 .. en) where f is not forall'd diff --git a/testsuite/tests/rename/should_fail/T2310.hs b/testsuite/tests/rename/should_fail/T2310.hs deleted file mode 100644 index 10c9cbc72a..0000000000 --- a/testsuite/tests/rename/should_fail/T2310.hs +++ /dev/null @@ -1,5 +0,0 @@ -{-# OPTIONS_GHC -XScopedTypeVariables #-} - -module Foo where - -foo = let c = \ (x :: a) -> (x :: a) in co diff --git a/testsuite/tests/rename/should_fail/T2310.stderr b/testsuite/tests/rename/should_fail/T2310.stderr deleted file mode 100644 index 1ac633f290..0000000000 --- a/testsuite/tests/rename/should_fail/T2310.stderr +++ /dev/null @@ -1,5 +0,0 @@ - -T2310.hs:5:41: error: - • Variable not in scope: co - • Perhaps you meant one of these: - ‘c’ (line 5), ‘cos’ (imported from Prelude) diff --git a/testsuite/tests/rename/should_fail/T2901.stderr b/testsuite/tests/rename/should_fail/T2901.stderr index 2128989b4c..d5a5bbda9a 100644 --- a/testsuite/tests/rename/should_fail/T2901.stderr +++ b/testsuite/tests/rename/should_fail/T2901.stderr @@ -2,7 +2,3 @@ T2901.hs:6:5: error: Not in scope: data constructor ‘F.Foo’ No module named ‘F’ is imported. - -T2901.hs:6:13: error: - Not in scope: ‘F.field’ - No module named ‘F’ is imported. diff --git a/testsuite/tests/rename/should_fail/T5372.stderr b/testsuite/tests/rename/should_fail/T5372.stderr index f6a466eb6c..d8b8e8fa56 100644 --- a/testsuite/tests/rename/should_fail/T5372.stderr +++ b/testsuite/tests/rename/should_fail/T5372.stderr @@ -2,7 +2,3 @@ T5372.hs:4:11: error: Not in scope: data constructor ‘MkS’ Perhaps you meant ‘T5372a.MkS’ (imported from T5372a) - -T5372.hs:4:17: error: - Not in scope: ‘x’ - Perhaps you meant ‘T5372a.x’ (imported from T5372a) diff --git a/testsuite/tests/rename/should_fail/T5513.stderr b/testsuite/tests/rename/should_fail/T5513.stderr index 063f34822b..4ce02ace8b 100644 --- a/testsuite/tests/rename/should_fail/T5513.stderr +++ b/testsuite/tests/rename/should_fail/T5513.stderr @@ -1,2 +1,4 @@ -T5513.hs:4:19: Malformed instance: lowercase_name a +T5513.hs:4:19: error: + • Instance head is not headed by a class: lowercase_name a + • In the stand-alone deriving instance for ‘lowercase_name a’ diff --git a/testsuite/tests/rename/should_fail/T5951.stderr b/testsuite/tests/rename/should_fail/T5951.stderr index af0ee9d431..a6969971ab 100644 --- a/testsuite/tests/rename/should_fail/T5951.stderr +++ b/testsuite/tests/rename/should_fail/T5951.stderr @@ -1,2 +1,19 @@ -T5951.hs:8:8: Malformed instance: A => B => C +T5951.hs:8:8: error: + • Expecting one more argument to ‘A’ + Expected a constraint, but ‘A’ has kind ‘* -> Constraint’ + • In the instance declaration for ‘B => C’ + +T5951.hs:8:8: error: + • Instance head is not headed by a class: C + • In the instance declaration for ‘B => C’ + +T5951.hs:9:8: error: + • Expecting one more argument to ‘B’ + Expected a constraint, but ‘B’ has kind ‘* -> Constraint’ + • In the instance declaration for ‘B => C’ + +T5951.hs:10:8: error: + • Expecting one more argument to ‘C’ + Expected a constraint, but ‘C’ has kind ‘* -> Constraint’ + • In the instance declaration for ‘B => C’ diff --git a/testsuite/tests/rename/should_fail/T8448.stderr b/testsuite/tests/rename/should_fail/T8448.stderr index e5834fbcaf..4b84290863 100644 --- a/testsuite/tests/rename/should_fail/T8448.stderr +++ b/testsuite/tests/rename/should_fail/T8448.stderr @@ -1,2 +1,6 @@ -T8448.hs:5:21: ‘r’ is not a (visible) field of constructor ‘[]’ +T8448.hs:5:17: error: + • Constructor ‘[]’ does not have field ‘r’ + • In the first argument of ‘undefined’, namely ‘[] {r = x}’ + In the expression: undefined [] {r = x} + In an equation for ‘f’: f x = undefined [] {r = x} diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T index f7f77192c8..182dc421fb 100644 --- a/testsuite/tests/rename/should_fail/all.T +++ b/testsuite/tests/rename/should_fail/all.T @@ -60,7 +60,6 @@ test('rnfail056', normal, compile_fail, ['']) test('rnfail057', normal, compile_fail, ['']) test('rn_dup', normal, compile_fail, ['']) -test('T2310', normal, compile_fail, ['']) test('T2490', normal, compile_fail, ['']) test('T2901', normal, compile_fail, ['']) test('T2723', normal, compile, ['']) # Warnings only @@ -120,11 +119,20 @@ test('T10781', normal, compile_fail, ['']) test('T11071', normal, compile_fail, ['']) test('T11071a', normal, compile_fail, ['']) test('T11663', normal, compile_fail, ['']) +test('T12146', normal, compile_fail, ['']) test('T12229', normal, compile, ['']) test('T12681', normal, multimod_compile_fail, ['T12681','-v0']) test('T12686', normal, compile_fail, ['']) test('T11592', normal, compile_fail, ['']) test('T12879', normal, compile_fail, ['']) -test('T13644', expect_broken(13644), multimod_compile_fail, ['T13644','-v0']) +test('T13644', normal, multimod_compile_fail, ['T13644','-v0']) test('T13568', normal, multimod_compile_fail, ['T13568','-v0']) test('T13947', normal, compile_fail, ['']) +test('T13847', normal, multimod_compile_fail, ['T13847','-v0']) +test('T14307', normal, compile_fail, ['']) +test('T14591', normal, compile_fail, ['']) +test('T15214', normal, compile_fail, ['']) +test('T15539', normal, compile_fail, ['']) +test('T15487', normal, multimod_compile_fail, ['T15487','-v0']) +test('T15659', normal, compile_fail, ['']) +test('T15607', normal, compile_fail, ['']) diff --git a/testsuite/tests/rename/should_fail/rnfail026.hs b/testsuite/tests/rename/should_fail/rnfail026.hs index d09d9fc22f..2d22df20d4 100644 --- a/testsuite/tests/rename/should_fail/rnfail026.hs +++ b/testsuite/tests/rename/should_fail/rnfail026.hs @@ -1,6 +1,6 @@ {-# LANGUAGE RankNTypes, FlexibleInstances #-} --- This one made ghc-4.08 crash +-- This one made ghc-4.08 crash -- rename/RnEnv.lhs:239: Non-exhaustive patterns in function get_tycon_key -- The type in the Monad instance is utterly bogus, of course @@ -9,11 +9,12 @@ module ShouldCompile ( Set ) where data Set a = Set [a] deriving (Eq, Ord, Read, Show) - +{- instance Functor Set where f `fmap` (Set xs) = Set $ f `fmap` xs - +-} instance Monad (forall a. Eq a => Set a) where return x = Set [x] - -instance Eq (forall a. [a]) where +{- +instance Eq (forall a. [a]) where +-} diff --git a/testsuite/tests/rename/should_fail/rnfail026.stderr b/testsuite/tests/rename/should_fail/rnfail026.stderr index dc6ee9691a..79b07c4d24 100644 --- a/testsuite/tests/rename/should_fail/rnfail026.stderr +++ b/testsuite/tests/rename/should_fail/rnfail026.stderr @@ -1,11 +1,10 @@ +rnfail026.hs:16:10: error: + • Illegal polymorphic type: forall a. Eq a => Set a + • In the instance declaration for ‘Monad (forall a. Eq a => Set a)’ + rnfail026.hs:16:27: error: - • Expecting one fewer arguments to ‘Set a’ - Expected kind ‘* -> *’, but ‘Set a’ has kind ‘*’ + • Expected kind ‘* -> *’, but ‘Set a’ has kind ‘*’ • In the first argument of ‘Monad’, namely ‘(forall a. Eq a => Set a)’ In the instance declaration for ‘Monad (forall a. Eq a => Set a)’ - -rnfail026.hs:19:10: error: - • Illegal polymorphic type: forall a. [a] - • In the instance declaration for ‘Eq (forall a. [a])’ diff --git a/testsuite/tests/rename/should_fail/rnfail028.stderr b/testsuite/tests/rename/should_fail/rnfail028.stderr index f09cda3f33..848e39e920 100644 --- a/testsuite/tests/rename/should_fail/rnfail028.stderr +++ b/testsuite/tests/rename/should_fail/rnfail028.stderr @@ -1,2 +1,3 @@ -rnfail028.hs:2:21: The export item `module List' is not imported +rnfail028.hs:2:21: error: + The export item ‘module List’ is not imported diff --git a/testsuite/tests/rename/should_fail/rnfail040.stderr b/testsuite/tests/rename/should_fail/rnfail040.stderr index 1d49aed612..f16607c07f 100644 --- a/testsuite/tests/rename/should_fail/rnfail040.stderr +++ b/testsuite/tests/rename/should_fail/rnfail040.stderr @@ -3,7 +3,7 @@ rnfail040.hs:7:12: error: Conflicting exports for ‘nub’: ‘module M’ exports ‘M.nub’ imported from ‘Data.List’ at rnfail040.hs:10:2-22 - (and originally defined in ‘base-4.10.0.0:Data.OldList’) + (and originally defined in ‘base-4.12.0.0:Data.OldList’) ‘module M’ exports ‘T.nub’ imported from ‘Rnfail040_A’ at rnfail040.hs:11:2-24 (and originally defined at Rnfail040_A.hs:2:3-5) diff --git a/testsuite/tests/rename/should_fail/rnfail044.stderr b/testsuite/tests/rename/should_fail/rnfail044.stderr index 6dcf2ca8f9..39f7b77056 100644 --- a/testsuite/tests/rename/should_fail/rnfail044.stderr +++ b/testsuite/tests/rename/should_fail/rnfail044.stderr @@ -1,7 +1,8 @@ rnfail044.hs:5:12: error: Ambiguous occurrence ‘splitAt’ - It could refer to either ‘Data.List.splitAt’, - imported from ‘Prelude’ at rnfail044.hs:5:8 - (and originally defined in ‘GHC.List’) - or ‘A.splitAt’, defined at rnfail044.hs:8:3 + It could refer to + either ‘Prelude.splitAt’, + imported from ‘Prelude’ at rnfail044.hs:5:8 + (and originally defined in ‘GHC.List’) + or ‘A.splitAt’, defined at rnfail044.hs:8:3 diff --git a/testsuite/tests/rename/should_fail/rnfail055.stderr b/testsuite/tests/rename/should_fail/rnfail055.stderr index 7fc5d80bad..b9ba174519 100644 --- a/testsuite/tests/rename/should_fail/rnfail055.stderr +++ b/testsuite/tests/rename/should_fail/rnfail055.stderr @@ -71,10 +71,8 @@ RnFail055.hs-boot:25:1: error: Type constructor ‘T7’ has conflicting definitions in the module and its hs-boot file Main module: type role T7 phantom - data T7 a where - T7 :: a1 -> T7 a - Boot file: data T7 a where - T7 :: a -> T7 a + data T7 a = forall a1. T7 a1 + Boot file: data T7 a = forall b. T7 a The roles do not match. Roles on abstract types default to ‘representational’ in boot files. The constructors do not match: The types for ‘T7’ differ |