diff options
Diffstat (limited to 'testsuite/tests/parser')
-rw-r--r-- | testsuite/tests/parser/should_compile/DumpSemis.stderr | 140 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/KindSigs.stderr | 16 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T17594b.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T17594b.stderr | 9 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T17594c.hs | 6 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T17594c.stderr | 11 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T17594e.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T17594e.stderr | 5 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/T18251d.stderr | 6 | ||||
-rw-r--r-- | testsuite/tests/parser/should_fail/all.T | 3 |
10 files changed, 143 insertions, 64 deletions
diff --git a/testsuite/tests/parser/should_compile/DumpSemis.stderr b/testsuite/tests/parser/should_compile/DumpSemis.stderr index 9147e29ec4..c488bc0113 100644 --- a/testsuite/tests/parser/should_compile/DumpSemis.stderr +++ b/testsuite/tests/parser/should_compile/DumpSemis.stderr @@ -1402,12 +1402,16 @@ (NoSrcStrict)) [(L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:32:3 }) - (VarPat + (VisPat (NoExtField) (L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:32:3 }) - (Unqual - {OccName: x}))))] + (VarPat + (NoExtField) + (L + (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:32:3 }) + (Unqual + {OccName: x}))))))] (GRHSs (EpaComments []) @@ -1761,12 +1765,16 @@ (NoSrcStrict)) [(L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:36:5 }) - (VarPat + (VisPat (NoExtField) (L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:36:5 }) - (Unqual - {OccName: x}))))] + (VarPat + (NoExtField) + (L + (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:36:5 }) + (Unqual + {OccName: x}))))))] (GRHSs (EpaComments []) @@ -1849,21 +1857,25 @@ (CaseAlt) [(L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:39:6 }) - (NPat - (EpAnnNotUsed) + (VisPat + (NoExtField) (L - (SrcSpanAnn + (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:39:6 }) + (NPat (EpAnnNotUsed) - { DumpSemis.hs:39:6 }) - (OverLit - (NoExtField) - (HsIntegral - (IL - (SourceText 0) - (False) - (0))))) - (Nothing) - (NoExtField)))] + (L + (SrcSpanAnn + (EpAnnNotUsed) + { DumpSemis.hs:39:6 }) + (OverLit + (NoExtField) + (HsIntegral + (IL + (SourceText 0) + (False) + (0))))) + (Nothing) + (NoExtField)))))] (GRHSs (EpaComments []) @@ -1918,21 +1930,25 @@ (CaseAlt) [(L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:40:6 }) - (NPat - (EpAnnNotUsed) + (VisPat + (NoExtField) (L - (SrcSpanAnn + (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:40:6 }) + (NPat (EpAnnNotUsed) - { DumpSemis.hs:40:6 }) - (OverLit - (NoExtField) - (HsIntegral - (IL - (SourceText 1) - (False) - (1))))) - (Nothing) - (NoExtField)))] + (L + (SrcSpanAnn + (EpAnnNotUsed) + { DumpSemis.hs:40:6 }) + (OverLit + (NoExtField) + (HsIntegral + (IL + (SourceText 1) + (False) + (1))))) + (Nothing) + (NoExtField)))))] (GRHSs (EpaComments []) @@ -1989,21 +2005,25 @@ (CaseAlt) [(L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:41:6 }) - (NPat - (EpAnnNotUsed) + (VisPat + (NoExtField) (L - (SrcSpanAnn + (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:41:6 }) + (NPat (EpAnnNotUsed) - { DumpSemis.hs:41:6 }) - (OverLit - (NoExtField) - (HsIntegral - (IL - (SourceText 2) - (False) - (2))))) - (Nothing) - (NoExtField)))] + (L + (SrcSpanAnn + (EpAnnNotUsed) + { DumpSemis.hs:41:6 }) + (OverLit + (NoExtField) + (HsIntegral + (IL + (SourceText 2) + (False) + (2))))) + (Nothing) + (NoExtField)))))] (GRHSs (EpaComments []) @@ -2062,21 +2082,25 @@ (CaseAlt) [(L (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:42:6 }) - (NPat - (EpAnnNotUsed) + (VisPat + (NoExtField) (L - (SrcSpanAnn + (SrcSpanAnn (EpAnnNotUsed) { DumpSemis.hs:42:6 }) + (NPat (EpAnnNotUsed) - { DumpSemis.hs:42:6 }) - (OverLit - (NoExtField) - (HsIntegral - (IL - (SourceText 3) - (False) - (3))))) - (Nothing) - (NoExtField)))] + (L + (SrcSpanAnn + (EpAnnNotUsed) + { DumpSemis.hs:42:6 }) + (OverLit + (NoExtField) + (HsIntegral + (IL + (SourceText 3) + (False) + (3))))) + (Nothing) + (NoExtField)))))] (GRHSs (EpaComments []) diff --git a/testsuite/tests/parser/should_compile/KindSigs.stderr b/testsuite/tests/parser/should_compile/KindSigs.stderr index f9b9a986e4..4d504287be 100644 --- a/testsuite/tests/parser/should_compile/KindSigs.stderr +++ b/testsuite/tests/parser/should_compile/KindSigs.stderr @@ -876,12 +876,20 @@ (NoSrcStrict)) [(L (SrcSpanAnn (EpAnnNotUsed) { KindSigs.hs:23:5 }) - (WildPat - (NoExtField))) + (VisPat + (NoExtField) + (L + (SrcSpanAnn (EpAnnNotUsed) { KindSigs.hs:23:5 }) + (WildPat + (NoExtField))))) ,(L (SrcSpanAnn (EpAnnNotUsed) { KindSigs.hs:23:7 }) - (WildPat - (NoExtField)))] + (VisPat + (NoExtField) + (L + (SrcSpanAnn (EpAnnNotUsed) { KindSigs.hs:23:7 }) + (WildPat + (NoExtField)))))] (GRHSs (EpaComments []) diff --git a/testsuite/tests/parser/should_fail/T17594b.hs b/testsuite/tests/parser/should_fail/T17594b.hs new file mode 100644 index 0000000000..c0f92f9b26 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T17594b.hs @@ -0,0 +1,6 @@ +module T17594b where + +foo :: forall a. a -> a +foo @a = + case a of + @a -> id diff --git a/testsuite/tests/parser/should_fail/T17594b.stderr b/testsuite/tests/parser/should_fail/T17594b.stderr new file mode 100644 index 0000000000..a41e27242e --- /dev/null +++ b/testsuite/tests/parser/should_fail/T17594b.stderr @@ -0,0 +1,9 @@ + +T17594b.hs:5:3: error: + Unexpected case expression in function application: + case a of {} + Suggested fixes: + • Use parentheses. + • Perhaps you intended to use BlockArguments + +T17594b.hs:6:8: error: parse error on input ‘->’ diff --git a/testsuite/tests/parser/should_fail/T17594c.hs b/testsuite/tests/parser/should_fail/T17594c.hs new file mode 100644 index 0000000000..1cb84bccb7 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T17594c.hs @@ -0,0 +1,6 @@ +module T17594c where + +foo :: forall a m. Monad m => a -> m a +foo x = do + @a <- undefined + return (x :: a) diff --git a/testsuite/tests/parser/should_fail/T17594c.stderr b/testsuite/tests/parser/should_fail/T17594c.stderr new file mode 100644 index 0000000000..d93da5d6a5 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T17594c.stderr @@ -0,0 +1,11 @@ + +T17594c.hs:4:9: error: + Unexpected do block in function application: + do + Suggested fixes: + • Use parentheses. + • Perhaps you intended to use BlockArguments + +T17594c.hs:5:6: error: + parse error on input ‘<-’ + Suggested fix: Possibly caused by a missing 'do'? diff --git a/testsuite/tests/parser/should_fail/T17594e.hs b/testsuite/tests/parser/should_fail/T17594e.hs new file mode 100644 index 0000000000..92608eddec --- /dev/null +++ b/testsuite/tests/parser/should_fail/T17594e.hs @@ -0,0 +1,5 @@ +module T17594e where + +thing :: forall a b. (a -> b) -> a -> b +thing @a @b f x = f x +thing @a = \ @b f x -> f x diff --git a/testsuite/tests/parser/should_fail/T17594e.stderr b/testsuite/tests/parser/should_fail/T17594e.stderr new file mode 100644 index 0000000000..543113b4a5 --- /dev/null +++ b/testsuite/tests/parser/should_fail/T17594e.stderr @@ -0,0 +1,5 @@ + +T17594e.hs:4:1: error: + Equations for ‘thing’ have different numbers of arguments + T17594e.hs:4:1-21 + T17594e.hs:5:1-26 diff --git a/testsuite/tests/parser/should_fail/T18251d.stderr b/testsuite/tests/parser/should_fail/T18251d.stderr index 15825502e0..bf82c53290 100644 --- a/testsuite/tests/parser/should_fail/T18251d.stderr +++ b/testsuite/tests/parser/should_fail/T18251d.stderr @@ -1,4 +1,6 @@ T18251d.hs:6:1: error: - Parse error in pattern: f @a - Type applications in patterns are only allowed on data constructors. + • @-binders in functions are not allowed yet + • In an equation for ‘f’: f @a _ = () + The equation for ‘f’ has two value arguments, + but its type ‘a -> ()’ has only one diff --git a/testsuite/tests/parser/should_fail/all.T b/testsuite/tests/parser/should_fail/all.T index 4d70833bed..786b9829fe 100644 --- a/testsuite/tests/parser/should_fail/all.T +++ b/testsuite/tests/parser/should_fail/all.T @@ -208,3 +208,6 @@ test('OpaqueParseFail4', normal, compile_fail, ['']) test('T20385A', normal, compile_fail, ['']) test('T20385B', normal, compile_fail, ['']) test('T16999', normal, compile_fail, ['']) +test('T17594b', normal, compile_fail, ['']) +test('T17594c', normal, compile_fail, ['']) +test('T17594e', normal, compile_fail, ['']) |