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
c5719bed
Commit
c5719bed
authored
Jul 11, 2018
by
Finn Teegen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consider data constructors when checking for duplicate definitions
Fix
#24
parent
c0a5efbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/Checks/SyntaxCheck.hs
src/Checks/SyntaxCheck.hs
+3
-2
No files found.
src/Checks/SyntaxCheck.hs
View file @
c5719bed
...
...
@@ -74,8 +74,8 @@ import Env.Value (ValueEnv, ValueInfo (..))
syntaxCheck
::
[
KnownExtension
]
->
TCEnv
->
ValueEnv
->
Module
()
->
((
Module
()
,
[
KnownExtension
]),
[
Message
])
syntaxCheck
exts
tcEnv
vEnv
mdl
@
(
Module
_
m
_
_
ds
)
=
case
findMultiples
$
con
catMap
constrs
td
s
of
[]
->
case
findMultiples
(
ls
++
fs
++
cs
)
of
case
findMultiples
cons
of
[]
->
case
findMultiples
(
ls
++
fs
++
cons
++
cs
)
of
[]
->
runSC
(
checkModule
mdl
)
state
iss
->
((
mdl
,
exts
),
map
(
errMultipleDeclarations
m
)
iss
)
css
->
((
mdl
,
exts
),
map
errMultipleDataConstructor
css
)
...
...
@@ -83,6 +83,7 @@ syntaxCheck exts tcEnv vEnv mdl@(Module _ m _ _ ds) =
tds
=
filter
isTypeDecl
ds
vds
=
filter
isValueDecl
ds
cds
=
filter
isClassDecl
ds
cons
=
concatMap
constrs
tds
ls
=
nub
$
concatMap
recLabels
tds
fs
=
nub
$
concatMap
vars
vds
cs
=
concatMap
(
concatMap
methods
)
$
[
ds'
|
ClassDecl
_
_
_
_
ds'
<-
cds
]
...
...
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