Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
curry
curry-frontend
Commits
5c6b4664
Commit
5c6b4664
authored
Aug 08, 2014
by
Björn Peemöller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a flag for enabling/disabling warnings for missing type signatures
parent
edf79a9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
src/Checks/WarnCheck.hs
src/Checks/WarnCheck.hs
+1
-1
src/CompilerOpts.hs
src/CompilerOpts.hs
+6
-2
No files found.
src/Checks/WarnCheck.hs
View file @
5c6b4664
...
...
@@ -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
...
...
src/CompilerOpts.hs
View file @
5c6b4664
...
...
@@ -158,13 +158,15 @@ 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
stdWarnFlags
::
[
WarnFlag
]
stdWarnFlags
=
[
WarnMultipleImports
,
WarnDisjoinedRules
,
WarnUnusedBindings
,
WarnNameShadowing
,
WarnOverlapping
,
WarnIncompletePatterns
[
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment