benmerckx / genes

Generates split ES6 modules and Typescript definitions from Haxe modules.
44 stars 8 forks source link

Abstract not resolved properly in Syntax.code() #17

Closed kevinresol closed 4 years ago

kevinresol commented 4 years ago
class Main {
    static public function main() {
        js.Syntax.code("parseFloat({0})", new Foo().foo());
    }
}

abstract Foo(String) {
    public inline function new()
        this = '';

    public function foo() {
        return '100';
    }
}

generated:

var this1 = "";
parseFloat(Foo.foo(this1));

class Foo_Impl_ {
  // ...
}

Note that the correct reference should be Foo_Impl_.foo instead of Foo.foo. Only happens in js.Syntax.code