TC tolerates incompatible neutral elements for fold-WLs
|
|
Bugzilla Link |
48 |
Created on |
Aug 26, 2004 01:20 |
Resolution |
FIXED |
Resolved on |
Oct 14, 2005 18:58 |
Version |
1.00beta |
OS |
All |
Architecture |
All |
Attachments |
bug_neutral.sac |
Extended Description
The TC tolerates fold-WLs like this one
with (...) fold( +, 0, a)
where a is a vector.
Since a is a vector, the first fold operation requires a function
+: int[] -> int[.] -> int[.]
the remaining fold operations require a function
+: int[.] -> int[.] -> int[.]
However, sac2c builds only the second instance of + (and the
compiler can't handle multiple fold-functions anyways...) as a
consequence, the compiled program causes a runtime error due to
incompatible types...
So, what should be done about it? I think, the TC should tolerate
only neutral elements with the same shape as the fold values...
An example SAC program will be given as attachment