Commit 5c6b4664 authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Added a flag for enabling/disabling warnings for missing type signatures

parent edf79a9a
......@@ -407,7 +407,7 @@ checkFieldExpression (Field _ _ e) = checkExpr e -- Hier auch "visitId ident" ?
-- during syntax checking
checkMissingTypeSignatures :: [Decl] -> WCM ()
checkMissingTypeSignatures decls = do
checkMissingTypeSignatures decls = warnFor WarnMissingSignatures $ do
let typedFs = [f | TypeSig _ fs _ <- decls, f <- fs]
untypedFs = [f | FunctionDecl _ f _ <- decls, f `notElem` typedFs]
unless (null untypedFs) $ do
......
......@@ -158,6 +158,7 @@ data WarnFlag
| WarnOverlapping -- ^ Warn for overlapping rules/alternatives
| WarnIncompletePatterns -- ^ Warn for incomplete pattern matching
| WarnNondetPatterns -- ^ Warn for non-deterministic pattern matching
| WarnMissingSignatures -- ^ Warn for missing type signatures
deriving (Eq, Bounded, Enum, Show)
-- |Warning flags enabled by default
......@@ -165,6 +166,7 @@ stdWarnFlags :: [WarnFlag]
stdWarnFlags =
[ WarnMultipleImports , WarnDisjoinedRules, WarnUnusedBindings
, WarnNameShadowing , WarnOverlapping , WarnIncompletePatterns
, WarnMissingSignatures
]
-- |Description and flag of warnings flags
......@@ -184,6 +186,8 @@ warnFlags =
, "incomplete pattern matching")
, ( WarnNondetPatterns , "nondet-patterns"
, "Nondeterministic patterns" )
, ( WarnMissingSignatures , "missing-signatures"
, "missing type signatures" )
]
-- |Dump level
......
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