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
e3a3648e
Commit
e3a3648e
authored
Aug 11, 2014
by
Björn Peemöller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Temporarily disabled overlapping warnings (broken)
parent
23dedde4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
src/Checks/WarnCheck.hs
src/Checks/WarnCheck.hs
+8
-7
test/OverlappingPatterns.curry
test/OverlappingPatterns.curry
+9
-5
No files found.
src/Checks/WarnCheck.hs
View file @
e3a3648e
...
...
@@ -280,8 +280,8 @@ checkFunctionPatternMatch p f eqs = do
warnMissingPattern
p
loc
nonExhaustive
unless
(
null
overlapped
)
$
warnFor
WarnNondetPatterns
$
report
$
warnOverlapPattern
p
loc
(
idName
f
)
"="
overlapped
when
nondet
$
warnFor
WarnOverlapping
$
report
$
warnNondetOverlapping
p
(
"Function "
++
escName
f
)
--
when nondet $ warnFor WarnOverlapping $ report $
--
warnNondetOverlapping p ("Function " ++ escName f)
-- Check an equation for warnings.
-- This is done in a seperate scope as the left-hand-side may introduce
...
...
@@ -426,9 +426,10 @@ getTyScheme q = do
"Checks.WarnCheck.getTyScheme: "
++
show
q
warnMissingTypeSignature
::
ModuleIdent
->
Ident
->
TypeScheme
->
Message
warnMissingTypeSignature
mid
i
tys
=
posMessage
i
$
hsep
(
map
text
[
"Top-level binding with no type signature:"
,
showIdent
i
,
"::"
])
<+>
ppTypeScheme
mid
tys
warnMissingTypeSignature
mid
i
tys
=
posMessage
i
$
fsep
[
text
"Top-level binding with no type signature:"
,
text
(
showIdent
i
)
<+>
text
"::"
<+>
ppTypeScheme
mid
tys
]
-- -----------------------------------------------------------------------------
-- Check for overlapping module alias names
...
...
@@ -474,8 +475,8 @@ checkCaseAlts ct alts@(Alt p _ _ : _) = do
warnMissingPattern
p
loc
nonExhaustive
unless
(
null
overlapped
)
$
warnFor
WarnNondetPatterns
$
report
$
warnOverlapPattern
p
loc
""
"->"
overlapped
when
nondet
$
warnFor
WarnOverlapping
$
report
$
warnNondetOverlapping
p
(
"A fcase expression"
)
--
when nondet $ warnFor WarnOverlapping $ report $
--
warnNondetOverlapping p ("A fcase expression")
Rigid
->
do
unless
(
null
nonExhaustive
)
$
warnFor
WarnIncompletePatterns
$
report
$
warnMissingPattern
p
loc
nonExhaustive
...
...
test/OverlappingPatterns.curry
View file @
e3a3648e
h x = fcase x of
f [] _ = Nothing
f (_ : _) [] = Nothing
f ((_, _) : _) ((_, _) : _) = Nothing
g x = fcase x of
"" -> 0
[] -> 1
i
x = fcase x of
g
x = fcase x of
[_] -> 0
(_:[]) -> 1
_ -> 2
i x = x
i y = y
j [] = 0
j (_:_) = 0
j x = 1
h x = x
h y = y
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