timowest / scalagen

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

bad constructor for base class #46

Closed jmvanel closed 11 years ago

jmvanel commented 11 years ago

This Java :

class Base {
  Base(){} // unused
  Base(String s){} // used
}
class Derived extends Base {
  Derived(String s){ super(s); }
}

gives this :

class Base() {
  def this(s: String) {
  }
}
class Derived(s: String) extends Base(s)
timowest commented 11 years ago

This is now correctly generated as

class Base() {
  def this(s: String) {
    this()
  }
}

class Derived(s: String) extends Base(s)