Skip ahead on error elaboration for source -> target | null | undefined when source is atomic · Issue #25086 · microsoft/TypeScript (original) (raw)

https://twitter.com/mattferderer/status/1009249732512841728

It's great that the user is happy we caught a bug, but we sure didn't need that elaboration when checking against CSSProperties | undefined. TypeScript ends up repeating itself on the next level checking directly against CSSProperties.

image

Does it make sense to always just get the non-nullable version of the target type if the source type is a non-union type?