diff options
author | johnvg | 2007-04-12 11:56:19 +0000 |
---|---|---|
committer | johnvg | 2007-04-12 11:56:19 +0000 |
commit | bdf7cd91b17bd073b04e9820957db71fbd6347fb (patch) | |
tree | 99d003de7ed3710e0d5852c57e395e9d7feddd78 /frontend/type.icl | |
parent | remove unused type Choice (diff) |
implement {# and {! in array comprehensions that create a new array
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1671 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'frontend/type.icl')
-rw-r--r-- | frontend/type.icl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend/type.icl b/frontend/type.icl index 6574e31..2a349bd 100644 --- a/frontend/type.icl +++ b/frontend/type.icl @@ -1758,6 +1758,15 @@ where requirements _ (ABCCodeExpr _ _) (reqs, ts) # (fresh_v, ts) = freshAttributedVariable ts = (fresh_v, No, (reqs, ts)) + requirements ti (TypeSignature make_fresh_type_function expr) (reqs, ts) + # {ts_var_store,ts_attr_store} = ts + (type,ts_var_store,ts_attr_store) = make_fresh_type_function ts_var_store ts_attr_store + ts = {ts & ts_var_store=ts_var_store,ts_attr_store=ts_attr_store} + (e_type, opt_expr_ptr, (reqs, ts)) = requirements ti expr (reqs, ts) + new_coercion = {tc_demanded=type, tc_offered=e_type, tc_position=CP_Expression expr, tc_coercible=True} + reqs = { reqs & req_type_coercions = [new_coercion : reqs.req_type_coercions ] } + ts = { ts & ts_expr_heap = storeAttribute opt_expr_ptr type.at_attribute ts.ts_expr_heap } + = (type, No, (reqs, ts)) requirements _ expr reqs_ts = (abort ("Error in requirements\n" ---> expr), No, reqs_ts) |