title: Expression Tree with Property Inheritance causes an argument exception
body: <p>Following this post: <a href="https://stackoverflow.com/questions/1937072/how-can-i-write-custom-comparison-definition-for-binary-operator-equal-for-enti">link text</a> I'm trying to create an expression tree that references the property of a property. My code looks like this:</p>
  
  <pre><code>public interface IFoo
  {
      void X {get;set;}
  }
  
  public interface IBar : IFoo
  {
      void Y {get;set;}
  }
  
  public interface IFooBarContainer
  {
      IBar Bar {get;set;}
  }
  
  public class Filterer
  {
       //Where T = "IFooBarContainer"
       public IQueryable&lt;T&gt; Filter&lt;T&gt;(IEnumerable&lt;T&gt; collection)
       {
                var argument = Expression.Parameter(typeof (T), "item");
  
                //...
  
                 //where propertyName = "IBar.X";
                 PropertyOfProperty(argument, propertyName); 
       }
  
          private static MemberExpression PropertyOfProperty(Expression expr, string propertyName)
          {
              return propertyName.Split('.').Aggregate&lt;string, MemberExpression&gt;(null, (current, property) =&gt; Expression.Property(current ?? expr, property));
          }
  }
  </code></pre>
  
  <p>I receive the exception:</p>
  
  <blockquote>
    <p>System.ArgumentException: Instance
    property 'X' is not defined for type
    'IBar'</p>
  </blockquote>
  
  <p>ReSharper turned the code in the link above into the condensed statement in my example. Both forms of the method returned the same error.</p>
  
  <p>If I reference <code>IBar.Y</code> the method does not fail.</p>