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
}
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: