Is it a mistake to return a list if the return type is an enumerable
<p>I have often the case where I want to return an <code>Enumerable&lt;T&gt;</code> from a method or a property. To build the returning <code>Enumerable&lt;T&gt;</code>, I use a <code>List&lt;T&gt;</code>-instance. After filling the list, I return the list.</p>

<p>I always thought that this is enough. But it exists the possibility that the caller casts the resulting <code>Enumerable&lt;T&gt;</code> back into the <code>List&lt;T&gt;</code> and begins to work further with it. If in a later time I change the implementation of my method, the caller’s code will fail. To avoid this, I could return list.ToArray or make a read-only list before returning it to the caller. But for me this seems to be a big overkill. What do you think?</p>

<p>Please note, <strong>I never will return an internally used list</strong> so that the caller can change my objects internal state. The question is only about a short living list that is built temporary to hold the return values.</p>

<pre><code>IEnumerable&lt;string&gt; GetAList() {
    List&lt;string&gt; aList = new List&lt;string&gt;();
    aList.Add("a");
    aList.Add("b");
    return aList;
}

IEnumerable&lt;string&gt; GetAList() {
    List&lt;string&gt; aList = new List&lt;string&gt;();
    aList.Add("a");
    aList.Add("b");
    return aList.ToArray&lt;string&gt;();
}
</code></pre>

<p>The examples are super-simple and in this case I would work from the beginning on with arrays, but it’s only to show explain the question.</p>
