summaryrefslogtreecommitdiff
path: root/compiler/GHC/HsToCore/GuardedRHSs.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/HsToCore/GuardedRHSs.hs')
-rw-r--r--compiler/GHC/HsToCore/GuardedRHSs.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/GHC/HsToCore/GuardedRHSs.hs b/compiler/GHC/HsToCore/GuardedRHSs.hs
index 68162187b8..8a991e9ceb 100644
--- a/compiler/GHC/HsToCore/GuardedRHSs.hs
+++ b/compiler/GHC/HsToCore/GuardedRHSs.hs
@@ -30,6 +30,7 @@ import GHC.Core.Type ( Type )
import GHC.Utils.Misc
import GHC.Types.SrcLoc
import GHC.Utils.Outputable
+import GHC.Core.Multiplicity
import Control.Monad ( zipWithM )
import Data.List.NonEmpty ( NonEmpty, toList )
@@ -124,7 +125,10 @@ matchGuards (LetStmt _ binds : stmts) ctx rhs rhs_ty = do
matchGuards (BindStmt _ pat bind_rhs : stmts) ctx rhs rhs_ty = do
let upat = unLoc pat
- match_var <- selectMatchVar upat
+ match_var <- selectMatchVar Many upat
+ -- We only allow unrestricted patterns in guard, hence the `Many`
+ -- above. It isn't clear what linear patterns would mean, maybe we will
+ -- figure it out in the future.
match_result <- matchGuards stmts ctx rhs rhs_ty
core_rhs <- dsLExpr bind_rhs