title: How does an inline list override a property with no setter?
body: <p>I have an Item class that has a publicly accessible member NoSetter that does not contain a setter. The object does explicitly state a get, which retrieves a private readonly List object.</p>
  
  <pre><code>class Item
  {
      private readonly List&lt;string&gt; emptyString;
  
      public Item()
      {
          this.emptyString = new List&lt;string&gt;();
      }
  
      public List&lt;string&gt; NoSetter
      {
          get { return this.emptyString; }
      }
  }
  </code></pre>
  
  <p>When you create this object, you can't set NoSetter to a list, the compiler fails whenever you try.  </p>
  
  <pre><code>List&lt;string&gt; goldenString = new List&lt;string&gt;();
  goldenString.Add("Nope");
  Item item = new Item()
  {
      NoSetter = goldenString
      // or NoSetter = new List&lt;string&gt;();
  };
  </code></pre>
  
  <p>However if you create the list inline you're able to set NoSetter.</p>
  
  <pre><code>Item item = new Item()
  {
      NoSetter = { "But this still works" }
  };
  
  // Outputs: "But this still works"
  Console.WriteLine(item.NoSetter.First&lt;string&gt;());
  </code></pre>
  
  <p>I expect that the NoSetter.Get method should be returning the readonly list emptyString , but instead returns the inlined NoSetter object.  What causes this in .net? Is it expected?</p>