11

Why is it not possible to have implicitly-typed variables at a class level within C# for when these variables are immediately assigned?

ie:

public class TheClass
{
    private var aList = new List<string>();
}

Is it just something that hasn't been implemented or is there a conceptual/technical reason for why it hasn't been done?

David Neale
  • 16,498
  • 6
  • 59
  • 85

1 Answers1

12

Here's a blog post from Eric that explains the reasoning.

Dean Harding
  • 71,468
  • 13
  • 145
  • 180