git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix true not being treated as an infallible guard
ac58693Gary Burgess
src/Language/PureScript/Linter/Exhaustive.hs+5−3
@@ -201,9 +201,11 @@ isExhaustiveGuard :: Either [(Guard, Expr)] Expr -> Bool
201isExhaustiveGuard (Left gs) = not . null $ filter (\(g, _) -> isOtherwise g) gs
201isExhaustiveGuard (Left gs) = not . null $ filter (\(g, _) -> isOtherwise g) gs
202 where
202 where
203 isOtherwise :: Expr -> Bool
203 isOtherwise :: Expr -> Bool
204− isOtherwise (TypedValue _ (BooleanLiteral True) _) = True
204+ isOtherwise (BooleanLiteral True) = True
205− isOtherwise (TypedValue _ (Var (Qualified (Just (ModuleName [ProperName "Prelude"])) (Ident "otherwise"))) _) = True
205+ isOtherwise (Var (Qualified (Just (ModuleName [ProperName "Prelude"])) (Ident "otherwise"))) = True
206− isOtherwise (TypedValue _ (Var (Qualified (Just (ModuleName [ProperName "Data", ProperName "Boolean"])) (Ident "otherwise"))) _) = True
206+ isOtherwise (Var (Qualified (Just (ModuleName [ProperName "Data", ProperName "Boolean"])) (Ident "otherwise"))) = True
207+ isOtherwise (TypedValue _ e _) = isOtherwise e
208+ isOtherwise (PositionedValue _ _ e) = isOtherwise e
207 isOtherwise _ = False
209 isOtherwise _ = False
208isExhaustiveGuard (Right _) = True
210isExhaustiveGuard (Right _) = True
209
211