[Git][ghc/ghc][wip/marge_bot_batch_merge_job] Parser regression tests, close #12862 #12446

Marge Bot gitlab at gitlab.haskell.org
Mon Oct 19 02:43:15 UTC 2020



 Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
86a9f089 by Vladislav Zavialov at 2020-10-18T22:43:08-04:00
Parser regression tests, close #12862 #12446

These issues were fixed by earlier parser changes, most likely related
to whitespace-sensitive parsing.

- - - - -


5 changed files:

- + testsuite/tests/parser/should_compile/T12862.hs
- testsuite/tests/parser/should_compile/all.T
- + testsuite/tests/parser/should_fail/T12446.hs
- + testsuite/tests/parser/should_fail/T12446.stderr
- testsuite/tests/parser/should_fail/all.T


Changes:

=====================================
testsuite/tests/parser/should_compile/T12862.hs
=====================================
@@ -0,0 +1,16 @@
+{-# LANGUAGE TypeFamilies, InstanceSigs #-}
+{-# LANGUAGE BangPatterns #-}  -- should parse even with BangPatterns enabled
+
+module T12862 where
+
+import Data.Kind (Type)
+
+class Key key where
+  data TotalMap key :: Type -> Type
+  (!) :: TotalMap key val -> (key -> val)
+
+instance Key Bool where
+  data TotalMap Bool val = BoolMap val val
+  (!) :: TotalMap Bool val -> (Bool -> val)
+  (BoolMap f _) ! False = f   -- with parentheses
+  BoolMap f _ ! True = f      -- without parentheses


=====================================
testsuite/tests/parser/should_compile/all.T
=====================================
@@ -170,3 +170,4 @@ test('proposal-229f',
 
 test('T15730a', normal, compile_and_run, [''])
 test('T18130', normal, compile, [''])
+test('T12862', normal, compile, [''])


=====================================
testsuite/tests/parser/should_fail/T12446.hs
=====================================
@@ -0,0 +1,3 @@
+module T12446 where
+
+x = undefined @(_ ~ _)


=====================================
testsuite/tests/parser/should_fail/T12446.stderr
=====================================
@@ -0,0 +1,4 @@
+
+T12446.hs:3:5: error:
+    Illegal visible type application ‘@(_ ~ _)’
+      Perhaps you intended to use TypeApplications


=====================================
testsuite/tests/parser/should_fail/all.T
=====================================
@@ -173,3 +173,4 @@ test('T18251c', normal, compile_fail, [''])
 test('T18251d', normal, compile_fail, [''])
 test('T18251e', normal, compile_fail, [''])
 test('T18251f', normal, compile_fail, [''])
+test('T12446', normal, compile_fail, [''])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/86a9f089a0c0aaa8d8d706415a4ae394b7924c79

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/86a9f089a0c0aaa8d8d706415a4ae394b7924c79
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201018/486e8d12/attachment-0001.html>


More information about the ghc-commits mailing list