Closed
Description
this can be seen in the nightly build as of Dec 17 (as well as at playground)
interface ReadOnlyData {
readonly value: number;
}
interface WritableData {
value: number;
}
function erase(data: WritableData): void {
data.value = 0;
}
const readOnly: ReadOnlyData = { value: 1 };
erase(readOnly); // expected a type error, actual: no problem
this can't be serious, can it?
why is it called readonly?
please note there are no type assertions or any other attempts to trick the type system, it just simply doesn't work
50+ errors left uncaught
UPDATE
constructive discussion starts here: #13002 (comment)