aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorronny2002-02-13 13:51:36 +0000
committerronny2002-02-13 13:51:36 +0000
commit25b1f0e46426639cee89038457521d42198bc577 (patch)
tree98d2173728e72211b4a2e26459159d4f7f864bd9
parentdon't try to read inline code from the abc file that is (diff)
work around for incorrect merging of cases (see source comment)
git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@1022 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
-rw-r--r--frontend/mergecases.icl18
1 files changed, 18 insertions, 0 deletions
diff --git a/frontend/mergecases.icl b/frontend/mergecases.icl
index d1f5787..35571b0 100644
--- a/frontend/mergecases.icl
+++ b/frontend/mergecases.icl
@@ -94,6 +94,23 @@ where
No
-> (No, var_heap, symbol_heap)
DynamicPatterns [dynamic_pattern]
+/*
+ Don't merge dynamic cases, as a work around for the following case
+ apply :: Dynamic Dynamic -> Int
+ apply _ (_ :: Int)
+ = 1
+ apply (f :: a ) (x :: a)
+ = 2
+ This work around leads to less efficient code.
+
+ mergeCases changes the order of matching of (f :: a) and
+ (x :: a), but the auxilary dynamics administration is not
+ updated.
+
+ FIXME: Update auxilary dynamics administration when dynamic cases
+ are reversed.
+
+
# (split_result, var_heap, symbol_heap) = split_case split_var_info_ptr dynamic_pattern.dp_rhs var_heap symbol_heap
-> case split_result of
Yes split_case
@@ -103,6 +120,7 @@ where
-> (Yes cees, var_heap, symbol_heap)
No
+*/
-> (No, var_heap, symbol_heap)
_
-> (No, var_heap, symbol_heap)