|
|
|
|
|
by phillipcarter
1544 days ago
|
|
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. |
|
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.