timowest / scalagen

Java to Scala transformation
Apache License 2.0
217 stars 32 forks source link

Method containing only a switch block results in invalid syntax #70

Closed erikkaplun closed 10 years ago

erikkaplun commented 10 years ago

This:

public class TestCls {
    public void doSmth(int i) {
        switch (i) {
        case 3:
            return;
        }
    }
}

gets converted to:

class TestCls {
  def doSmth(i: Int) i match {  // ERROR: '=' expected but identifier found
    case 3 => return
  }
}

...the generated method body should either be wrapped in { and } or prefixed with =.