function foo(this: object, value: string) {
print(value);
}
function bar(this: void, value: string) {
print(value);
}
const array = ['a'];
array.forEach(foo);
array.forEach(bar);
This code doesn't throw compilation error, but has invalid runtime behavior. The same code, but with const array: ReadonlyArray<string> = ['a']; (#480) correctly errors, so it's caused by a missing check during handling of library functions.
This code doesn't throw compilation error, but has invalid runtime behavior. The same code, but with
const array: ReadonlyArray<string> = ['a'];(#480) correctly errors, so it's caused by a missing check during handling of library functions.