Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's not really called out as such, but the C# 8 feature Nullable Reference Types is an example of deeply embedding flow typing into a language. The nullability state of a reference type can change based on many things you can do in code. It's really neat and extremely intricate.


It's exactly that.

e.g. inside "if (x != null) { }", or after "x = y ?? throw new ArgumentNullException()" then x is known not null.

C# has flow types, but only in this specific and limited way. You could say that about a lot of programming language features.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: