[Git][ghc/ghc][wip/or-pats] Minor things

David (@knothed) gitlab at gitlab.haskell.org
Mon Jan 30 09:20:17 UTC 2023



David pushed to branch wip/or-pats at Glasgow Haskell Compiler / GHC


Commits:
84751d09 by David Knothe at 2023-01-30T10:20:11+01:00
Minor things

- - - - -


2 changed files:

- compiler/GHC/Rename/Bind.hs
- testsuite/tests/driver/T4437.hs


Changes:

=====================================
compiler/GHC/Rename/Bind.hs
=====================================
@@ -537,7 +537,6 @@ isOkNoBindPattern (L _ pat) =
   case pat of
     WildPat{}       -> True -- Exception (1)
     BangPat {}      -> True -- Exception (2) #9127, #13646
-    OrPat {}        -> True
     p -> patternContainsSplice p -- Exception (3)
 
     where
@@ -553,7 +552,6 @@ isOkNoBindPattern (L _ pat) =
           -- The base cases
           VarPat {} -> False
           WildPat {} -> False
-          OrPat {} -> False
           LitPat {} -> False
           NPat {} -> False
           NPlusKPat {} -> False
@@ -563,6 +561,7 @@ isOkNoBindPattern (L _ pat) =
           AsPat _ _ _ lp  -> lpatternContainsSplice lp
           ParPat _ _ lp _ -> lpatternContainsSplice lp
           ViewPat _ _ lp -> lpatternContainsSplice lp
+          OrPat _ lps -> any lpatternContainsSplice lps
           SigPat _ lp _  -> lpatternContainsSplice lp
           ListPat _ lps  -> any lpatternContainsSplice lps
           TuplePat _ lps _ -> any lpatternContainsSplice lps


=====================================
testsuite/tests/driver/T4437.hs
=====================================
@@ -55,5 +55,6 @@ expectedCabalOnlyExtensions = ["Generics",
                                "MonadFailDesugaring",
                                "MonoPatBinds",
                                -- https://github.com/haskell/cabal/pull/8521
-                               "RequiredTypeArguments"
+                               "RequiredTypeArguments",
+                               "OrPatterns"
                               ]



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84751d0923a1deb6ec1a1d708e979b3630c97fbc

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/84751d0923a1deb6ec1a1d708e979b3630c97fbc
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/20230130/c69a20f5/attachment-0001.html>


More information about the ghc-commits mailing list