Implement reference counting (#592)

This commit is contained in:
Daniel Wirtz
2019-06-05 23:15:39 +02:00
committed by GitHub
parent 3ed76a97f0
commit 0484a6b740
601 changed files with 261645 additions and 146131 deletions

View File

@ -0,0 +1,30 @@
// Expect error: TS2540
// ^ TODO: Properly handle multiple
function localConst(a: i32): void {
const b = a + 1;
b = 3;
}
localConst(1);
function localConstInline(): void {
const a = 1;
a = 2;
}
localConstInline();
function localConstArray(a: i32): void {
const b: i32[] = [ a ];
b = [ 2 ];
}
localConstArray(1);
function localConstArrayInline(): void {
const a: i32[] = [ 1 ];
a = [ 2 ];
}
localConstArrayInline();
// globalConst
const a = 1;
a = 2;