|
|
|
|
|
by foepys
1155 days ago
|
|
I don't get TypeScript's type system. It is obviously very powerful and can model very complex type constraints. But then you have stuff like this where it is not checking types as I would expect: interface Foo { bar: string; }
const f = {bar: "foobar"} as Readonly<Foo>;
function someFunc(): Foo {
return f; // No error or warning, even with all strict flags enabled
}
|
|
https://github.com/microsoft/TypeScript/issues/13347