Commit e3a3648e authored by Björn Peemöller 's avatar Björn Peemöller

Temporarily disabled overlapping warnings (broken)

parent 23dedde4
...@@ -280,8 +280,8 @@ checkFunctionPatternMatch p f eqs = do ...@@ -280,8 +280,8 @@ checkFunctionPatternMatch p f eqs = do
warnMissingPattern p loc nonExhaustive warnMissingPattern p loc nonExhaustive
unless (null overlapped) $ warnFor WarnNondetPatterns $ report $ unless (null overlapped) $ warnFor WarnNondetPatterns $ report $
warnOverlapPattern p loc (idName f) "=" overlapped warnOverlapPattern p loc (idName f) "=" overlapped
when nondet $ warnFor WarnOverlapping $ report $ -- when nondet $ warnFor WarnOverlapping $ report $
warnNondetOverlapping p ("Function " ++ escName f) -- warnNondetOverlapping p ("Function " ++ escName f)
-- Check an equation for warnings. -- Check an equation for warnings.
-- This is done in a seperate scope as the left-hand-side may introduce -- This is done in a seperate scope as the left-hand-side may introduce
...@@ -426,9 +426,10 @@ getTyScheme q = do ...@@ -426,9 +426,10 @@ getTyScheme q = do
"Checks.WarnCheck.getTyScheme: " ++ show q "Checks.WarnCheck.getTyScheme: " ++ show q
warnMissingTypeSignature :: ModuleIdent -> Ident -> TypeScheme -> Message warnMissingTypeSignature :: ModuleIdent -> Ident -> TypeScheme -> Message
warnMissingTypeSignature mid i tys = posMessage i $ hsep (map text warnMissingTypeSignature mid i tys = posMessage i $ fsep
["Top-level binding with no type signature:", showIdent i, "::"]) [ text "Top-level binding with no type signature:"
<+> ppTypeScheme mid tys , text (showIdent i) <+> text "::" <+> ppTypeScheme mid tys
]
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
-- Check for overlapping module alias names -- Check for overlapping module alias names
...@@ -474,8 +475,8 @@ checkCaseAlts ct alts@(Alt p _ _ : _) = do ...@@ -474,8 +475,8 @@ checkCaseAlts ct alts@(Alt p _ _ : _) = do
warnMissingPattern p loc nonExhaustive warnMissingPattern p loc nonExhaustive
unless (null overlapped) $ warnFor WarnNondetPatterns $ report $ unless (null overlapped) $ warnFor WarnNondetPatterns $ report $
warnOverlapPattern p loc "" "->" overlapped warnOverlapPattern p loc "" "->" overlapped
when nondet $ warnFor WarnOverlapping $ report $ -- when nondet $ warnFor WarnOverlapping $ report $
warnNondetOverlapping p ("A fcase expression") -- warnNondetOverlapping p ("A fcase expression")
Rigid -> do Rigid -> do
unless (null nonExhaustive) $ warnFor WarnIncompletePatterns $ report $ unless (null nonExhaustive) $ warnFor WarnIncompletePatterns $ report $
warnMissingPattern p loc nonExhaustive warnMissingPattern p loc nonExhaustive
......
h x = fcase x of f [] _ = Nothing
f (_ : _) [] = Nothing
f ((_, _) : _) ((_, _) : _) = Nothing
g x = fcase x of
"" -> 0 "" -> 0
[] -> 1 [] -> 1
i x = fcase x of g x = fcase x of
[_] -> 0 [_] -> 0
(_:[]) -> 1 (_:[]) -> 1
_ -> 2 _ -> 2
i x = x
i y = y
j [] = 0 j [] = 0
j (_:_) = 0 j (_:_) = 0
j x = 1 j x = 1
h x = x
h y = y
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment