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

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



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


Commits:
b802d5c7 by David Knothe at 2023-01-30T10:56:45+01:00
Minor things

- - - - -


3 changed files:

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


Changes:

=====================================
compiler/GHC/Rename/Bind.hs
=====================================
@@ -536,7 +536,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
@@ -552,7 +551,6 @@ isOkNoBindPattern (L _ pat) =
           -- The base cases
           VarPat {} -> False
           WildPat {} -> False
-          OrPat {} -> False
           LitPat {} -> False
           NPat {} -> False
           NPlusKPat {} -> False
@@ -562,6 +560,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


=====================================
compiler/GHC/Types/Error/Codes.hs
=====================================
@@ -470,8 +470,6 @@ type family GhcDiagnosticCode c = n | n -> c where
   GhcDiagnosticCode "TcRnNonOverloadedSpecialisePragma"             = 35827
   GhcDiagnosticCode "TcRnSpecialiseNotVisible"                      = 85337
   GhcDiagnosticCode "TcRnIllegalTypeOperatorDecl"                   = 50649
-  GhcDiagnosticCode "TcRnNameByTemplateHaskellQuote"                = 40027
-  GhcDiagnosticCode "TcRnIllegalBindingOfBuiltIn"                   = 69639
   GhcDiagnosticCode "TcRnOrPatBindsVariables"                       = 81303
   GhcDiagnosticCode "TcRnIllegalHsigDefaultMethods"                 = 93006
   GhcDiagnosticCode "TcRnBadGenericMethod"                          = 59794


=====================================
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/b802d5c73965e6596eb2f4e4fd6536eecdc8f58c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/b802d5c73965e6596eb2f4e4fd6536eecdc8f58c
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/1d1f18fd/attachment-0001.html>


More information about the ghc-commits mailing list