Closed
Description
This code just crash whole compiler:
class ArrayIterator {
constructor(public start: i32, public end: i32) {}
next(): i32 {
let start = this.start + 1;
if (start <= end) { // This line caused crash (just missing this.end)
this.start = start;
return start;
}
return -1;
}
}
export function iter1(n: i32): i32 {
let iter = new ArrayIterator(0, n);
let acc = 0, val = 0;
while ((val = iter.next()) != -1) {
acc++;
}
return acc;
}