C# 8 surprising patterns

added by DotNetKicks
2/27/2019 1:40:31 PM

2 Kicks, 606 Views

Recently, I made a surprising discovery. I had downloaded a preview of Visual Studio 2019 and was experimenting with some of the new language features in C# 8, when I discovered something: Switching between var and int can sometimes move type checks from compile-time to runtime. This shocked me...