aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartinw2000-06-16 14:14:33 +0000
committermartinw2000-06-16 14:14:33 +0000
commitfdbbe0c98660f67ff0522579339919b667026d65 (patch)
tree36254b0f7003da207ab291a041e1599a84a84639
parentaccepting JVG's changes (diff)
added error message "not a record constructor", e.g. in the following case:
:: T :== Int f = { T | f1 = blub } git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@170 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/check.icl3
1 files changed, 3 insertions, 0 deletions
diff --git a/frontend/check.icl b/frontend/check.icl
index 0f691e8..c8cda08 100644
--- a/frontend/check.icl
+++ b/frontend/check.icl
@@ -517,6 +517,9 @@ checkFields mod_index field_ass opt_type e_info=:{ef_selector_defs,ef_type_defs,
Yes ({td_index,td_rhs = RecordType {rt_constructor,rt_fields}}, type_mod_index)
# (field_exprs, cs_error) = check_and_rearrange_fields type_mod_index 0 rt_fields field_ass cs.cs_error
-> (Yes ({ glob_object = rt_constructor, glob_module = type_mod_index }, td_index, field_exprs), e_info, { cs & cs_error = cs_error })
+ Yes _
+ # (Yes type_ident) = opt_type
+ -> (No, e_info, { cs & cs_error = checkError type_ident "not a record constructor" cs.cs_error })
No
-> (No, e_info, cs)
= (No, e_info, cs)