Aladdin - Scala Bugtracking
[#248] project: compiler priority: low category: bug
submitter assigned to status date submitted
Nikolay Nikolay fixed 2003-12-03 18:13:38.0
subject MSIL backend does not hadnle Switch tree nodes
code
Anything that would cause the sequence matcher to generate a Switch tree node.
what happened
The MSIL backend crashes because it doesn't handle Switch tree nodes. The .NET CLR  lacks the appropriate switch\
 instruction, so this will not be fixed soon.
what expected Working MSIL backend.
[back to overview]
Changes of this bug report
Burak  edited on  2003-12-03 18:40:33.0
I do not like the PatternMatcher or any other phase to be dependent on the backend to use.
A sane way that does the same is make TreeGen.Switch clever enough that it fakes switches with nested if..then..elses.
Given that TreeGen.Switch should be the only way to generate switches, this should be fine, although I really think this is the problem of the backend, and not even TreeGen should be polluted (Philippe told me, the interpreter works fine now).
Nikolay  edited on  2003-12-04 10:26:03.0
Changed the 'subject' and 'what expected' to reflect that this should be fixed in the MSIL backend (and better soon than later). Reassigned it to myself.
Nikolay  edited on  2003-12-17 16:41:10.0
Fixed. The MSIL backend now unrolls Switch nodes to a multitude of if-else-ifs.