Simn / genjvm

13 stars 1 forks source link

Missing super call on field-init-generated constructor #35

Closed Simn closed 5 years ago

Simn commented 5 years ago
class Base {
    public function new() { }
}

class Main extends Base {
    static public function main() {
        new Main();
    }

    var s:String = "foo";
}
java.lang.VerifyError: Constructor must call super() or this() before return
Exception Details:
  Location:
    Main.<init>()V @6: return
  Reason:
    Error exists in the bytecode

I probably shouldn't use add_field_inits at all anyway...

Simn commented 5 years ago

This works now.