Type inference != Dynamic typing
Local variable type inferencing is a new feature in C# 3.5 – a very “handy” one, in that it saves a lot of typing. Basically, it lets you do var dict = new Dictionary<string, List<int, Dictionary<int, string>>>(); instead of Dictionary<string, List<int, Dictionary<int, string>>> dict = Dictionary<string, List<int, Dictionary<int, string>>>(); That’s pretty cool, but remember, C# is still a statically typed language. dict is statically bound to the type Dictionary<string, List<int, Dictionary<int, string>>> and you cannot change it. You cannot do dict = Dictionary<int, string>(); in the same method. The compiler will complain that the type on the RHS is not … Continue reading Type inference != Dynamic typing