Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
curry-frontend
Commits
fa5fb06c
Commit
fa5fb06c
authored
Dec 18, 2012
by
Björn Peemöller
Browse files
Merge branch 'master' into flatcurry/typedexpr
parents
ad89f790
6ade1e64
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Checks/WarnCheck.hs
View file @
fa5fb06c
...
...
@@ -17,6 +17,7 @@ module Checks.WarnCheck (warnCheck) where
import
Control.Monad
(
filterM
,
foldM_
,
guard
,
unless
)
import
Control.Monad.State.Strict
(
State
,
execState
,
gets
,
modify
)
import
qualified
Data.Map
as
Map
(
empty
,
insert
,
lookup
)
import
Data.Maybe
(
isJust
)
import
Data.List
(
intersect
,
intersectBy
,
sort
,
unionBy
)
import
Text.PrettyPrint
...
...
@@ -468,7 +469,7 @@ insertConstrDecl (ConOpDecl _ _ _ op _) = insertConsId op
-- 'fp' indicates whether 'checkPattern' deals with the arguments
-- of a function pattern or not.
-- Since function patterns are not recognized before syntax check, it is
-- necessary to determine
,
whether a constructor pattern represents a
-- necessary to determine whether a constructor pattern represents a
-- constructor or a function.
insertPattern
::
Bool
->
Pattern
->
WCM
()
insertPattern
fp
(
VariablePattern
v
)
=
do
...
...
@@ -531,8 +532,9 @@ insertScope :: QualIdent -> IdInfo -> WCM ()
insertScope
qid
info
=
modifyScope
$
SE
.
insert
qid
info
insertVar
::
Ident
->
WCM
()
insertVar
v
=
unless
(
isAnonId
v
)
$
insertScope
(
commonId
v
)
(
VarInfo
v
False
)
insertVar
v
=
unless
(
isAnonId
v
)
$
do
known
<-
isKnownVar
v
if
known
then
visitId
v
else
insertScope
(
commonId
v
)
(
VarInfo
v
False
)
insertTypeVar
::
Ident
->
WCM
()
insertTypeVar
v
=
unless
(
isAnonId
v
)
...
...
@@ -579,6 +581,9 @@ visitQTypeId v = do
mid
<-
getModuleIdent
maybe
ok
visitTypeId
(
localIdent
mid
v
)
isKnownVar
::
Ident
->
WCM
Bool
isKnownVar
v
=
gets
$
\
s
->
isKnown
s
(
commonId
v
)
isUnrefTypeVar
::
Ident
->
WCM
Bool
isUnrefTypeVar
v
=
gets
(
\
s
->
isUnref
s
(
typeId
v
))
...
...
@@ -599,6 +604,11 @@ endScope = modifyScope SE.endScopeUp
------------------------------------------------------------------------------
isKnown
::
WcState
->
QualIdent
->
Bool
isKnown
s
qid
=
let
sc
=
scope
s
in
isJust
(
SE
.
lookup
qid
sc
)
&&
SE
.
level
qid
sc
==
SE
.
currentLevel
sc
isUnref
::
WcState
->
QualIdent
->
Bool
isUnref
s
qid
=
let
sc
=
scope
s
in
maybe
False
(
not
.
variableVisited
)
(
SE
.
lookup
qid
sc
)
...
...
test/NonLinearLHS.curry
View file @
fa5fb06c
double x x = True
multi x y y x = x + 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