aboutsummaryrefslogtreecommitdiff
path: root/frontend/type.icl
diff options
context:
space:
mode:
authorjohnvg2005-10-11 09:50:50 +0000
committerjohnvg2005-10-11 09:50:50 +0000
commit7fd049570823e7694deb6dc1388f75020bb2ad91 (patch)
tree0b3e1f83d5a4a0d86c8d3e0630af82f253db99ac /frontend/type.icl
parentincrement version number because descriptors and apply with >=2 arguments hav... (diff)
print types in error messages: 'derived type conflicts with specified type' and
'cannot unify types' on separate lines git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1549 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/type.icl')
-rw-r--r--frontend/type.icl32
1 files changed, 16 insertions, 16 deletions
diff --git a/frontend/type.icl b/frontend/type.icl
index f318cfb..e768913 100644
--- a/frontend/type.icl
+++ b/frontend/type.icl
@@ -215,10 +215,10 @@ cannotUnify t1 t2 position=:(CP_Expression expr) err=:{ea_loc=[ip:_]}
# err = pushErrorAdmin { ip & ip_ident.id_name = id_name, ip_line = line } err
err = errorHeading type_error err
err = popErrorAdmin err
-// -> { err & ea_file = err.ea_file <<< " cannot unify " <:: (type_error_format, t1, Yes initialTypeVarBeautifulizer)
-// <<< " with " <:: (type_error_format, t2, Yes initialTypeVarBeautifulizer) <<< '\n' }
- -> { err & ea_file = err.ea_file <<< " cannot unify " <:: (type_error_format, t1, No)
- <<< " with " <:: (type_error_format, t2, No) <<< '\n' }
+ # err = { err & ea_file = err.ea_file <<< " cannot unify types:\n" }
+ # err = { err & ea_file = err.ea_file <<< " " <:: (type_error_format, t1, No) <<< '\n' }
+ # err = { err & ea_file = err.ea_file <<< " " <:: (type_error_format, t2, No) <<< '\n' }
+ -> err;
_
-> cannot_unify t1 t2 position err
cannotUnify t1 t2 position err
@@ -233,17 +233,16 @@ cannot_unify t1 t2 position err
-> ea_file <<< "\"" <<< position <<< "\""
_
-> ea_file
- ea_file = ea_file <<< " cannot unify " <:: (type_error_format, t1, No)
- <<< " with " <:: (type_error_format, t2, No)
-// ea_file = ea_file <<< " cannot unify " <:: (type_error_format, t1, Yes initialTypeVarBeautifulizer)
-// <<< " with " <:: (type_error_format, t2, Yes initialTypeVarBeautifulizer)
+
ea_file = case position of
CP_Expression _
- -> ea_file <<< " near " <<< position
+ -> ea_file <<< " near " <<< position <<< " :"
_
-> ea_file
- = { err & ea_file = ea_file <<< '\n' }
-
+ ea_file = ea_file <<< " cannot unify types:\n"
+ ea_file = ea_file <<< " " <:: (type_error_format, t1, No) <<< "\n"
+ ea_file = ea_file <<< " " <:: (type_error_format, t2, No) <<< "\n"
+ = { err & ea_file = ea_file}
existentialError position=:(CP_Expression expr) err=:{ea_loc=[ip:_]}
= case tryToOptimizePosition expr of
@@ -2080,11 +2079,12 @@ where
specification_error type type1 err
# err = errorHeading "Type error" err
format = { form_properties = cAttributed, form_attr_position = No}
- = { err & ea_file = err.ea_file <<< " derived type "
- <:: (format, type, Yes initialTypeVarBeautifulizer)
- <<< " conflicts with specified type "
- <:: (format, type1, Yes initialTypeVarBeautifulizer)
- <<< '\n' }
+ # err = { err & ea_file = err.ea_file <<< "derived type conflicts with specified type:" <<< '\n' }
+ # format = { form_properties = cAttributed, form_attr_position = No}
+ # err = { err & ea_file = err.ea_file <<< " " <:: (format, type, Yes initialTypeVarBeautifulizer) <<< '\n' }
+ # format = { form_properties = cAttributed, form_attr_position = No}
+ # err = { err & ea_file = err.ea_file <<< " " <:: (format, type1, Yes initialTypeVarBeautifulizer) <<< '\n' }
+ = err
cleanUpAndCheckFunctionTypes [] _ _ start_index _ defs type_contexts coercion_env attr_partition type_var_env attr_var_env (out, ts)
= (out, ts)