Eric Lippert answered your question right here: Why no var on fields?
Basically, for the general case it would require re-writing the C# compiler, as the way it currently does type inference would not work for cycles of var
field variable assignments.
More Related Contents:
- Sum multidimensional array over dimensions [closed]
- How to auto-generate a C# class file from a JSON string [closed]
- Insert 2 million rows into SQL Server quickly
- Why are C# structs immutable?
- Disable Required validation attribute under certain circumstances
- string = string + int: What’s behind the scenes?
- Enter “&” symbol into a text Label in Windows Forms?
- How do I automatically scroll to the bottom of a multiline text box?
- Make ListView.ScrollIntoView Scroll the Item into the Center of the ListView (C#)
- Retrieve credentials from Windows Credentials Store using C#
- Why do we need the new keyword and why is the default behavior to hide and not override?
- Render Razor View to string in ASP.NET Core
- System.Data.SqlClient.SqlException: Login failed for user
- How to find one image inside of another?
- Why method overloading is not allowed in WCF?
- Check if datetime instance falls in between other two datetime objects
- Cannot resolve scoped service from root provider .Net Core 2
- Can EF automatically delete data that is orphaned, where the parent is not deleted?
- SetForegroundWindow only working while visual studio is open
- Waiting for all threads to complete, with a timeout
- How to add cookies to WebRequest?
- How to get user Browser name ( user-agent ) in Asp.net Core?
- Two-way binding of Xml data to the WPF TreeView
- Automating replacing tables from external files
- Persist Security Info Property=true and Persist Security Info Property=false
- Multiple Models in a Single View (C# MVC3)
- Use convolution to find a reference audio sample in a continuous stream of sound
- Connecting over internet to WCF service using wsDualHttpBinding times out
- How to set username and password for SmtpClient object in .NET?
- VB.NET equivalent of C# property shorthand?