Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
curry
curry-frontend
Commits
a701c13f
Commit
a701c13f
authored
Oct 09, 2014
by
Björn Peemöller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics
parent
ce2b3c4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
7 deletions
+11
-7
src/Checks/ExportCheck.hs
src/Checks/ExportCheck.hs
+2
-1
src/Checks/WarnCheck.hs
src/Checks/WarnCheck.hs
+5
-4
src/Interfaces.hs
src/Interfaces.hs
+1
-1
test/RecordTest.curry
test/RecordTest.curry
+3
-1
No files found.
src/Checks/ExportCheck.hs
View file @
a701c13f
...
...
@@ -134,7 +134,8 @@ expandTypeWith tc cs = do
[
t
]
|
isDataType
t
->
do
mapM_
(
checkConstr
$
constrs
t
)
nubCons
return
[
ExportTypeWith
(
origName
t
)
nubCons
]
|
isRecordType
t
->
do
mapM_
(
checkLabel
$
labels
t
)
nubCons
return
[
ExportTypeWith
(
origName
t
)
(
map
renameLabel
nubCons
)]
return
[
ExportTypeWith
(
origName
t
)
(
map
renameLabel
nubCons
)]
|
otherwise
->
report
(
errNonDataType
tc
)
>>
return
[]
_
->
report
(
errAmbiguousType
tc
)
>>
return
[]
where
...
...
src/Checks/WarnCheck.hs
View file @
a701c13f
...
...
@@ -404,9 +404,9 @@ checkFieldExpression (Field _ _ e) = checkExpr e -- Hier auch "visitId ident" ?
-- For external function declarations, this check is already performed
-- during syntax checking.
checkMissingTypeSignatures
::
[
Decl
]
->
WCM
()
checkMissingTypeSignatures
d
ecl
s
=
warnFor
WarnMissingSignatures
$
do
let
typedFs
=
[
f
|
TypeSig
_
fs
_
<-
d
ecl
s
,
f
<-
fs
]
untypedFs
=
[
f
|
FunctionDecl
_
f
_
<-
d
ecl
s
,
f
`
notElem
`
typedFs
]
checkMissingTypeSignatures
ds
=
warnFor
WarnMissingSignatures
$
do
let
typedFs
=
[
f
|
TypeSig
_
fs
_
<-
ds
,
f
<-
fs
]
untypedFs
=
[
f
|
FunctionDecl
_
f
_
<-
ds
,
f
`
notElem
`
typedFs
]
unless
(
null
untypedFs
)
$
do
mid
<-
getModuleIdent
tyScs
<-
mapM
getTyScheme
untypedFs
...
...
@@ -701,7 +701,8 @@ getConTy q = do
[
NewtypeConstructor
_
(
ForAllExist
_
_
ty
)]
->
ty
_
->
case
qualLookupTC
q
tcEnv
of
[
AliasType
_
_
ty
]
->
ty
_
->
internalError
$
"Checks.WarnCheck.getConTy: "
++
show
q
_
->
internalError
$
"Checks.WarnCheck.getConTy: "
++
show
q
-- |Retrieve all constructors of a given type.
getTyCons
::
QualIdent
->
Type
->
WCM
[
DataConstr
]
...
...
src/Interfaces.hs
View file @
a701c13f
...
...
@@ -110,7 +110,7 @@ compileInterface ctxt (p, m) fn = do
Just
src
->
case
runCYM
(
parseInterface
fn
src
)
of
Left
err
->
report
err
Right
intf
@
(
Interface
n
is
_
)
->
if
(
m
/=
n
)
if
m
/=
n
then
report
[
errWrongInterface
(
first
fn
)
m
n
]
else
do
let
(
intf'
,
intfErrs
)
=
intfSyntaxCheck
intf
...
...
test/RecordTest.curry
View file @
a701c13f
...
...
@@ -12,6 +12,8 @@ full = { intField := 1, boolField := True }
expr = empty :> intField + 1 == 0
match { intField = i | _ } = i
-- int :: { intField :: Int | a }
-- int = { intField := 0 }
...
...
@@ -20,4 +22,4 @@ type Record2 =
, boolField2 :: Bool
}
test = { intField := 0, boolField2 := True }
test = { intField
2
:= 0, boolField2 := True }
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