fasterthanlime / jooc-legacy

:crocodile: The historical, initial implementation of an ooc compiler in Java
http://ooc-lang.org/
MIT License
115 stars 4 forks source link

Match statements assigned to variable generated bad C code #71

Open joshthecoder opened 14 years ago

joshthecoder commented 14 years ago

j/ooc will generate incorrect C code with a match such as

x = match(y) {
    case 'a' => x + 1
    case 'b' => x + 2
}

The generated code looks like

x = if(...) {} else if (...) {}