diff options
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/dependent/should_fail/T16326_Fail6.stderr | 10 | ||||
-rw-r--r-- | testsuite/tests/gadt/T12087.stderr | 45 | ||||
-rw-r--r-- | testsuite/tests/gadt/T14320.hs | 4 | ||||
-rw-r--r-- | testsuite/tests/gadt/T14320.stderr | 4 | ||||
-rw-r--r-- | testsuite/tests/gadt/T16427.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/gadt/T18191.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/gadt/T18191.stderr | 20 | ||||
-rw-r--r-- | testsuite/tests/gadt/all.T | 3 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/T10399.stdout | 60 | ||||
-rw-r--r-- | testsuite/tests/ghc-api/annotations/Test10399.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/T15323.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/T15323.stderr | 116 |
12 files changed, 156 insertions, 139 deletions
diff --git a/testsuite/tests/dependent/should_fail/T16326_Fail6.stderr b/testsuite/tests/dependent/should_fail/T16326_Fail6.stderr index bb78e2f457..e4acd7a7fd 100644 --- a/testsuite/tests/dependent/should_fail/T16326_Fail6.stderr +++ b/testsuite/tests/dependent/should_fail/T16326_Fail6.stderr @@ -1,7 +1,5 @@ -T16326_Fail6.hs:9:3: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - MkFoo :: forall a. a -> Foo a - • In the definition of data constructor ‘MkFoo’ - In the data type declaration for ‘Foo’ +T16326_Fail6.hs:9:12: error: + Illegal visible, dependent quantification in the type of a term + (GHC does not yet support this) + In the definition of data constructor ‘MkFoo’ diff --git a/testsuite/tests/gadt/T12087.stderr b/testsuite/tests/gadt/T12087.stderr index 0039e98657..ef0251a003 100644 --- a/testsuite/tests/gadt/T12087.stderr +++ b/testsuite/tests/gadt/T12087.stderr @@ -1,35 +1,20 @@ -T12087.hs:6:3: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - MkF1 :: forall a. (Ord a, Eq a) => a -> F1 a - • In the definition of data constructor ‘MkF1’ - In the data type declaration for ‘F1’ +T12087.hs:6:20: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkF1’ -T12087.hs:9:3: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - MkF2 :: forall a. (Ord a, Eq a) => a -> F2 a - • In the definition of data constructor ‘MkF2’ - In the data type declaration for ‘F2’ +T12087.hs:9:25: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkF2’ -T12087.hs:12:3: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - MkF3 :: forall a b. (Eq a, Eq b) => a -> b -> F3 a - • In the definition of data constructor ‘MkF3’ - In the data type declaration for ‘F3’ +T12087.hs:12:34: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkF3’ -T12087.hs:15:3: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - MkF4 :: forall a b. (Eq a, Eq b) => a -> b -> F4 a - • In the definition of data constructor ‘MkF4’ - In the data type declaration for ‘F4’ +T12087.hs:15:36: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkF4’ -T12087.hs:18:3: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - MkF5 :: forall a b. Int -> Int -> a -> Int -> Int -> b -> F5 a - • In the definition of data constructor ‘MkF5’ - In the data type declaration for ‘F5’ +T12087.hs:18:25: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkF5’ diff --git a/testsuite/tests/gadt/T14320.hs b/testsuite/tests/gadt/T14320.hs index 77c68ee92e..270c92c37c 100644 --- a/testsuite/tests/gadt/T14320.hs +++ b/testsuite/tests/gadt/T14320.hs @@ -10,8 +10,8 @@ data Exp :: Type where newtype TypedExp :: Type -> Type where TEGood :: forall a . (Exp -> (TypedExp a)) --- The only difference here is that the type is wrapped in parentheses, --- but GHC 8.0.1 rejects this program +-- The presence of outer parentheses makes the `forall` nested, and +-- GADTs do not permit nested `forall`s. -- newtype TypedExpToo :: Type -> Type where TEBad :: (forall a . (Exp -> (TypedExpToo a))) diff --git a/testsuite/tests/gadt/T14320.stderr b/testsuite/tests/gadt/T14320.stderr new file mode 100644 index 0000000000..9cfb6ed9fc --- /dev/null +++ b/testsuite/tests/gadt/T14320.stderr @@ -0,0 +1,4 @@ + +T14320.hs:17:14: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘TEBad’ diff --git a/testsuite/tests/gadt/T16427.stderr b/testsuite/tests/gadt/T16427.stderr index 1c80190e29..b7288c9cd6 100644 --- a/testsuite/tests/gadt/T16427.stderr +++ b/testsuite/tests/gadt/T16427.stderr @@ -1,7 +1,4 @@ -T16427.hs:5:14: error: - • GADT constructor type signature cannot contain nested ‘forall’s or contexts - Suggestion: instead use this type signature: - C :: forall b. Int -> b -> D - • In the definition of data constructor ‘C’ - In the data type declaration for ‘D’ +T16427.hs:5:26: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘C’ diff --git a/testsuite/tests/gadt/T18191.hs b/testsuite/tests/gadt/T18191.hs new file mode 100644 index 0000000000..e30c7ad5b1 --- /dev/null +++ b/testsuite/tests/gadt/T18191.hs @@ -0,0 +1,16 @@ +{-# LANGUAGE GADTs #-} +{-# LANGUAGE RankNTypes #-} +module T18191 where + +data T where + MkT :: (forall a. a -> b -> T) + +data S a where + MkS :: (forall a. S a) + +data U a where + MkU :: (Show a => U a) + +data Z a where + MkZ1 :: forall a. forall b. { unZ1 :: (a, b) } -> Z (a, b) + MkZ2 :: Eq a => Eq b => { unZ1 :: (a, b) } -> Z (a, b) diff --git a/testsuite/tests/gadt/T18191.stderr b/testsuite/tests/gadt/T18191.stderr new file mode 100644 index 0000000000..b8c6c60bdc --- /dev/null +++ b/testsuite/tests/gadt/T18191.stderr @@ -0,0 +1,20 @@ + +T18191.hs:6:11: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkT’ + +T18191.hs:9:11: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkS’ + +T18191.hs:12:11: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkU’ + +T18191.hs:15:21: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkZ1’ + +T18191.hs:16:19: error: + GADT constructor type signature cannot contain nested ‘forall’s or contexts + In the definition of data constructor ‘MkZ2’ diff --git a/testsuite/tests/gadt/all.T b/testsuite/tests/gadt/all.T index 29bde94100..3c146820ae 100644 --- a/testsuite/tests/gadt/all.T +++ b/testsuite/tests/gadt/all.T @@ -113,10 +113,11 @@ test('T7558', normal, compile_fail, ['']) test('T9380', normal, compile_and_run, ['']) test('T12087', normal, compile_fail, ['']) test('T12468', normal, compile_fail, ['']) -test('T14320', normal, compile, ['']) +test('T14320', normal, compile_fail, ['']) test('T14719', normal, compile_fail, ['-fdiagnostics-show-caret']) test('T14808', normal, compile, ['']) test('T15009', normal, compile, ['']) test('T15558', normal, compile, ['']) test('T16427', normal, compile_fail, ['']) test('T17423', expect_broken(17423), compile_and_run, ['']) +test('T18191', normal, compile_fail, ['']) diff --git a/testsuite/tests/ghc-api/annotations/T10399.stdout b/testsuite/tests/ghc-api/annotations/T10399.stdout index a71abc4139..7588393264 100644 --- a/testsuite/tests/ghc-api/annotations/T10399.stdout +++ b/testsuite/tests/ghc-api/annotations/T10399.stdout @@ -34,9 +34,9 @@ ((Test10399.hs:12:30,AnnComma), [Test10399.hs:12:30]), ((Test10399.hs:12:31-32,AnnCloseP), [Test10399.hs:12:32]), ((Test10399.hs:12:31-32,AnnOpenP), [Test10399.hs:12:31]), -((Test10399.hs:(14,1)-(18,55),AnnData), [Test10399.hs:14:1-4]), -((Test10399.hs:(14,1)-(18,55),AnnSemi), [Test10399.hs:20:1]), -((Test10399.hs:(14,1)-(18,55),AnnWhere), [Test10399.hs:14:21-25]), +((Test10399.hs:(14,1)-(18,53),AnnData), [Test10399.hs:14:1-4]), +((Test10399.hs:(14,1)-(18,53),AnnSemi), [Test10399.hs:20:1]), +((Test10399.hs:(14,1)-(18,53),AnnWhere), [Test10399.hs:14:21-25]), ((Test10399.hs:15:5-64,AnnDcolon), [Test10399.hs:15:11-12]), ((Test10399.hs:15:5-64,AnnSemi), [Test10399.hs:16:5]), ((Test10399.hs:15:14-64,AnnDot), [Test10399.hs:15:23]), @@ -48,37 +48,29 @@ ((Test10399.hs:15:45-46,AnnBang), [Test10399.hs:15:45]), ((Test10399.hs:15:45-46,AnnRarrow), [Test10399.hs:15:48-49]), ((Test10399.hs:15:45-64,AnnRarrow), [Test10399.hs:15:48-49]), -((Test10399.hs:(16,5)-(17,69),AnnCloseP), [Test10399.hs:17:69]), -((Test10399.hs:(16,5)-(17,69),AnnDcolon), [Test10399.hs:16:12-13]), -((Test10399.hs:(16,5)-(17,69),AnnOpenP), [Test10399.hs:16:27]), -((Test10399.hs:(16,5)-(17,69),AnnSemi), [Test10399.hs:18:5]), -((Test10399.hs:(16,15)-(17,69),AnnDot), [Test10399.hs:16:25]), -((Test10399.hs:(16,15)-(17,69),AnnForall), [Test10399.hs:16:15-20]), -((Test10399.hs:(16,27)-(17,69),AnnCloseP), [Test10399.hs:17:69]), -((Test10399.hs:(16,27)-(17,69),AnnOpenP), [Test10399.hs:16:27]), -((Test10399.hs:16:28-43,AnnCloseP), [Test10399.hs:16:43, Test10399.hs:16:43]), -((Test10399.hs:16:28-43,AnnDarrow), [Test10399.hs:16:45-46]), -((Test10399.hs:16:28-43,AnnOpenP), [Test10399.hs:16:28, Test10399.hs:16:28]), -((Test10399.hs:16:30-33,AnnComma), [Test10399.hs:16:34]), -((Test10399.hs:16:48,AnnRarrow), [Test10399.hs:16:50-51]), -((Test10399.hs:(16,48)-(17,68),AnnRarrow), [Test10399.hs:16:50-51]), -((Test10399.hs:16:53-66,AnnRarrow), [Test10399.hs:17:45-46]), -((Test10399.hs:(16,53)-(17,68),AnnRarrow), [Test10399.hs:17:45-46]), -((Test10399.hs:17:48,AnnRarrow), [Test10399.hs:17:50-51]), -((Test10399.hs:17:48-68,AnnRarrow), [Test10399.hs:17:50-51]), -((Test10399.hs:17:66-68,AnnCloseS), [Test10399.hs:17:68]), -((Test10399.hs:17:66-68,AnnOpenS), [Test10399.hs:17:66]), -((Test10399.hs:18:5-55,AnnCloseP), [Test10399.hs:18:55]), -((Test10399.hs:18:5-55,AnnDcolon), [Test10399.hs:18:16-17]), -((Test10399.hs:18:5-55,AnnOpenP), [Test10399.hs:18:19]), -((Test10399.hs:18:19-55,AnnCloseP), [Test10399.hs:18:55]), -((Test10399.hs:18:19-55,AnnOpenP), [Test10399.hs:18:19]), -((Test10399.hs:18:20-54,AnnDot), [Test10399.hs:18:29]), -((Test10399.hs:18:20-54,AnnForall), [Test10399.hs:18:20-25]), -((Test10399.hs:18:31-36,AnnCloseP), [Test10399.hs:18:36]), -((Test10399.hs:18:31-36,AnnOpenP), [Test10399.hs:18:31]), -((Test10399.hs:18:31-36,AnnRarrow), [Test10399.hs:18:38-39]), -((Test10399.hs:18:31-54,AnnRarrow), [Test10399.hs:18:38-39]), +((Test10399.hs:(16,5)-(17,67),AnnDcolon), [Test10399.hs:16:12-13]), +((Test10399.hs:(16,5)-(17,67),AnnSemi), [Test10399.hs:18:5]), +((Test10399.hs:(16,15)-(17,67),AnnDot), [Test10399.hs:16:25]), +((Test10399.hs:(16,15)-(17,67),AnnForall), [Test10399.hs:16:15-20]), +((Test10399.hs:16:27-42,AnnCloseP), [Test10399.hs:16:42, Test10399.hs:16:42]), +((Test10399.hs:16:27-42,AnnDarrow), [Test10399.hs:16:44-45]), +((Test10399.hs:16:27-42,AnnOpenP), [Test10399.hs:16:27, Test10399.hs:16:27]), +((Test10399.hs:16:29-32,AnnComma), [Test10399.hs:16:33]), +((Test10399.hs:16:47,AnnRarrow), [Test10399.hs:16:49-50]), +((Test10399.hs:(16,47)-(17,67),AnnRarrow), [Test10399.hs:16:49-50]), +((Test10399.hs:16:52-65,AnnRarrow), [Test10399.hs:17:44-45]), +((Test10399.hs:(16,52)-(17,67),AnnRarrow), [Test10399.hs:17:44-45]), +((Test10399.hs:17:47,AnnRarrow), [Test10399.hs:17:49-50]), +((Test10399.hs:17:47-67,AnnRarrow), [Test10399.hs:17:49-50]), +((Test10399.hs:17:65-67,AnnCloseS), [Test10399.hs:17:67]), +((Test10399.hs:17:65-67,AnnOpenS), [Test10399.hs:17:65]), +((Test10399.hs:18:5-53,AnnDcolon), [Test10399.hs:18:16-17]), +((Test10399.hs:18:19-53,AnnDot), [Test10399.hs:18:28]), +((Test10399.hs:18:19-53,AnnForall), [Test10399.hs:18:19-24]), +((Test10399.hs:18:30-35,AnnCloseP), [Test10399.hs:18:35]), +((Test10399.hs:18:30-35,AnnOpenP), [Test10399.hs:18:30]), +((Test10399.hs:18:30-35,AnnRarrow), [Test10399.hs:18:37-38]), +((Test10399.hs:18:30-53,AnnRarrow), [Test10399.hs:18:37-38]), ((Test10399.hs:20:1-25,AnnCloseQ), [Test10399.hs:20:24-25]), ((Test10399.hs:20:1-25,AnnOpen), [Test10399.hs:20:1-3]), ((Test10399.hs:20:1-25,AnnSemi), [Test10399.hs:22:1]), diff --git a/testsuite/tests/ghc-api/annotations/Test10399.hs b/testsuite/tests/ghc-api/annotations/Test10399.hs index 6a35712bfd..bb3265000d 100644 --- a/testsuite/tests/ghc-api/annotations/Test10399.hs +++ b/testsuite/tests/ghc-api/annotations/Test10399.hs @@ -13,9 +13,9 @@ mkPoli = mkBila . map ((,,(),,()) <$> P.base <*> P.pos <*> P.form) data MaybeDefault v where SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v - SetTo4 :: forall v a. (( Eq v, Show v ) => v -> MaybeDefault v - -> a -> MaybeDefault [a]) - TestParens :: (forall v . (Eq v) -> MaybeDefault v) + SetTo4 :: forall v a. ( Eq v, Show v ) => v -> MaybeDefault v + -> a -> MaybeDefault [a] + TestParens :: forall v . (Eq v) -> MaybeDefault v [t| Map.Map T.Text $tc |] diff --git a/testsuite/tests/parser/should_compile/T15323.hs b/testsuite/tests/parser/should_compile/T15323.hs index ffc8ad85f0..42eb616141 100644 --- a/testsuite/tests/parser/should_compile/T15323.hs +++ b/testsuite/tests/parser/should_compile/T15323.hs @@ -3,4 +3,4 @@ module T15323 where data MaybeDefault v where - TestParens :: (forall v . (Eq v) => MaybeDefault v) + TestParens :: forall v . (Eq v) => MaybeDefault v diff --git a/testsuite/tests/parser/should_compile/T15323.stderr b/testsuite/tests/parser/should_compile/T15323.stderr index c69f94afba..c07f2d6a43 100644 --- a/testsuite/tests/parser/should_compile/T15323.stderr +++ b/testsuite/tests/parser/should_compile/T15323.stderr @@ -8,7 +8,7 @@ {ModuleName: T15323})) (Nothing) [] - [({ T15323.hs:(5,1)-(6,56) } + [({ T15323.hs:(5,1)-(6,54) } (TyClD (NoExtField) (DataDecl @@ -33,63 +33,67 @@ []) (Nothing) (Nothing) - [({ T15323.hs:6:5-56 } - (ConDeclGADT - (NoExtField) - [({ T15323.hs:6:5-14 } - (Unqual - {OccName: TestParens}))] - ({ T15323.hs:6:21-55 } - (True)) - [({ T15323.hs:6:28 } - (UserTyVar - (NoExtField) - (SpecifiedSpec) - ({ T15323.hs:6:28 } - (Unqual - {OccName: v}))))] - (Just - ({ T15323.hs:6:32-37 } - [({ T15323.hs:6:32-37 } - (HsParTy - (NoExtField) - ({ T15323.hs:6:33-36 } - (HsAppTy - (NoExtField) - ({ T15323.hs:6:33-34 } - (HsTyVar - (NoExtField) - (NotPromoted) - ({ T15323.hs:6:33-34 } - (Unqual - {OccName: Eq})))) - ({ T15323.hs:6:36 } - (HsTyVar - (NoExtField) - (NotPromoted) - ({ T15323.hs:6:36 } - (Unqual - {OccName: v}))))))))])) - (PrefixCon - []) - ({ T15323.hs:6:42-55 } - (HsAppTy + [({ T15323.hs:6:5-54 } + (XConDecl + (ConDeclGADTPrefixPs + [({ T15323.hs:6:5-14 } + (Unqual + {OccName: TestParens}))] + (HsIB (NoExtField) - ({ T15323.hs:6:42-53 } - (HsTyVar + ({ T15323.hs:6:20-54 } + (HsForAllTy (NoExtField) - (NotPromoted) - ({ T15323.hs:6:42-53 } - (Unqual - {OccName: MaybeDefault})))) - ({ T15323.hs:6:55 } - (HsTyVar - (NoExtField) - (NotPromoted) - ({ T15323.hs:6:55 } - (Unqual - {OccName: v})))))) - (Nothing)))] + (ForallInvis) + [({ T15323.hs:6:27 } + (UserTyVar + (NoExtField) + (SpecifiedSpec) + ({ T15323.hs:6:27 } + (Unqual + {OccName: v}))))] + ({ T15323.hs:6:31-54 } + (HsQualTy + (NoExtField) + ({ T15323.hs:6:31-36 } + [({ T15323.hs:6:31-36 } + (HsParTy + (NoExtField) + ({ T15323.hs:6:32-35 } + (HsAppTy + (NoExtField) + ({ T15323.hs:6:32-33 } + (HsTyVar + (NoExtField) + (NotPromoted) + ({ T15323.hs:6:32-33 } + (Unqual + {OccName: Eq})))) + ({ T15323.hs:6:35 } + (HsTyVar + (NoExtField) + (NotPromoted) + ({ T15323.hs:6:35 } + (Unqual + {OccName: v}))))))))]) + ({ T15323.hs:6:41-54 } + (HsAppTy + (NoExtField) + ({ T15323.hs:6:41-52 } + (HsTyVar + (NoExtField) + (NotPromoted) + ({ T15323.hs:6:41-52 } + (Unqual + {OccName: MaybeDefault})))) + ({ T15323.hs:6:54 } + (HsTyVar + (NoExtField) + (NotPromoted) + ({ T15323.hs:6:54 } + (Unqual + {OccName: v}))))))))))) + (Nothing))))] ({ <no location info> } [])))))] (Nothing) |