From 25b1f0e46426639cee89038457521d42198bc577 Mon Sep 17 00:00:00 2001 From: ronny Date: Wed, 13 Feb 2002 13:51:36 +0000 Subject: 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 --- frontend/mergecases.icl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'frontend') 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) -- cgit v1.2.3