title: Casting an object using the "as" keyword returns null
body: <p>Here are my classes definitions:</p>
  
  <pre><code>public abstract class AbstractEntity : ...
  public partial class AbstractContactEntity : AbstractEntity, ...
  public sealed class EntityCollectionProxy&lt;T&gt; : IList&lt;T&gt;, System.Collections.IList 
  where T : AbstractEntity
  </code></pre>
  
  <p>Now I get an object from a delegate and I want to cast it, and it doesn't work as I expect it to.</p>
  
  <pre><code>var obj = resolver.DynamicInvoke (this.entity);
  var col = obj as EntityCollectionProxy&lt;AbstractEntity&gt;;
  </code></pre>
  
  <p><code>obj</code> is of type <code>EntityCollectionProxy&lt;AbstractContactEntity&gt;</code>.</p>
  
  <p>But <code>col</code> is null.
  If I try the regular casting (var col = <code>(Entity...) obj</code>) I get an exception.</p>
  
  <p>I would expect that it work since the types are coherent. 
  What do I miss?</p>