Post

Right, I know how to work around it. But I am asking: Shouldn’t this be accepted by the type checker (because `null?.a` is perfectly valid)

0 reposts1 like

That's just how the object type works in typescript. You're asserting it's an object and then trying to use it like `any` but it's not equivalent.

Yes. I know how typescript currently works. I'm claiming that TS should change it's behavior here (hence why I said "this should not be a type error, right?"). I thought you were saying that what I was doing here is wrong at the type theory level, which I don't think is the case.