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
8310a909
Commit
8310a909
authored
Nov 02, 2012
by
Björn Peemöller
Browse files
Fixed bug in pretty-printing of field expressions for error messages
parent
53cbf3e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
curry-frontend.cabal
View file @
8310a909
...
...
@@ -35,7 +35,7 @@ Executable cymake
else
Build-Depends: base == 3.*
Build-Depends:
curry-base == 0.3.
4
curry-base == 0.3.
5
, mtl, containers, pretty, transformers
ghc-options: -Wall
Other-Modules:
...
...
src/Checks/TypeCheck.lhs
View file @
8310a909
...
...
@@ -938,9 +938,7 @@ because of possibly multiple occurrences of variables.
>
tcRhs
tyEnv0
rhs
>>=
>
unify
p1
"case branch"
doc
ty2
>
tcExpr
_
(
RecordConstr
fs
)
=
do
>
fts
<-
mapM
(
tcFieldExpr
equals
)
fs
>
--when (1 == length fs)
>
-- (error (show fs ++ "\n" ++ show fts))
>
fts
<-
mapM
tcFieldExpr
fs
>
return
(
TypeRecord
fts
Nothing
)
>
tcExpr
p
r
@
(
RecordSelection
e
l
)
=
do
>
m
<-
getModuleIdent
...
...
@@ -958,10 +956,9 @@ because of possibly multiple occurrences of variables.
>
let
rty
=
TypeRecord
[(
l
,
lty
)]
(
Just
alpha
)
>
unify
p
"record selection"
(
ppExpr
0
r
)
ty
rty
>
return
lty
>
tcExpr
p
r
@
(
RecordUpdate
fs
e
)
=
>
do
>
ty
<-
tcExpr
p
e
>
fts
<-
mapM
(
tcFieldExpr
(
text
":="
))
fs
>
tcExpr
p
r
@
(
RecordUpdate
fs
e
)
=
do
>
ty
<-
tcExpr
p
e
>
fts
<-
mapM
tcFieldExpr
fs
>
alpha
<-
freshVar
id
>
let
rty
=
TypeRecord
fts
(
Just
alpha
)
>
unify
p
"record update"
(
ppExpr
0
r
)
ty
rty
...
...
@@ -988,8 +985,8 @@ because of possibly multiple occurrences of variables.
>
unify
p
"statement"
(
ppStmt
st
$-$
text
"Term:"
<+>
ppExpr
0
e
)
(
ioType
ty1
)
ty2
>
tcStmt
_
(
StmtDecl
ds
)
=
tcDecls
ds
>
tcFieldExpr
::
Doc
->
Field
Expression
->
TCM
(
Ident
,
Type
)
>
tcFieldExpr
comb
f
@
(
Field
_
l
e
)
=
do
>
tcFieldExpr
::
Field
Expression
->
TCM
(
Ident
,
Type
)
>
tcFieldExpr
f
@
(
Field
_
l
e
)
=
do
>
m
<-
getModuleIdent
>
tyEnv
<-
getValueEnv
>
let
p
=
idPosition
l
...
...
@@ -1001,7 +998,7 @@ because of possibly multiple occurrences of variables.
>
inst
>
(
sureLabelType
l
tyEnv
)
>
ty
<-
tcExpr
p
e
>
unify
p
"record"
(
text
"Field:"
<+>
ppFieldExpr
comb
f
)
lty
ty
>
unify
p
"record"
(
text
"Field:"
<+>
ppFieldExpr
f
)
lty
ty
>
return
(
l
,
ty
)
\end{verbatim}
...
...
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