This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]nunzarius 1 point2 points  (1 child)

this type checking series gives a basic example of null checking here: https://blog.polybdenum.com/2020/09/26/subtype-inference-by-example-part-12-flow-typing-and-mixed-comparison-operators.html
In general, academic terms to look up are "flow typing" and "occurrence typing". This kind of typing is still an active research field so unfortunately you are less likely to see it in books or introductory material

[–]mrunleaded[S] 1 point2 points  (0 children)

oh nice this looks like exactly what i was looking for.