Closed
Description
interface X {
readonly value: 'x';
}
interface Y {
value: 'y';
}
type Z = X | Y;
var z: Z = <Z>{ value: 'y' };
z.value = 'x'; // expected an error saying that value: 'x' is readonly and cannot be set, actual OK
UPDATE:
even this example doesn't work (with both possible options being readonly
)
interface X {
readonly value: 'x';
}
interface Y {
readonly value: 'y';
}
type Z = X | Y;
var z: Z = <Z>{ value: 'y' };
z.value = 'x'; // expected an error saying that value: 'x' is readonly and cannot be set, actual OK