Add a 'call_indirect' builtin to emit arbitrary calls (might trap at runtime); Optimize 'for' loop compilation a bit

This commit is contained in:
dcodeIO
2018-05-25 15:59:17 +02:00
parent 51ede113dd
commit 7ad13f9d65
47 changed files with 3311 additions and 22111 deletions

View File

@ -0,0 +1,12 @@
class Foo {
baz(): void {}
}
class Bar extends Foo {
baz(): void {}
}
export function test(foo: Foo): void {
foo.baz();
}
// FIXME: this results in a call to Foo.baz instead of Bar.baz above.
// ultimately, overloaded functions should implicitly become virtual.
test(changetype<Bar>(0));