Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1493

Property expressions on properties that are covariant on a base class use the type of the base class property, not the covariant subclass

    Details

      Description

      public abstract class AbstractFoo
      {
      public abstract AbstractBar getBar();
      }

      public class Foo extends AbstractFoo
      {
      public Bar getBar();
      }

      Here property bar is covariant; the subclass (Foo) changes the type of the return value (from AbstractBar to just Bar). Assuming that Bar is a subclass of AbstractBar, that's fine.

      The bug is that in this circumstance, the PropertyConduitSource sees the type of
      property "bar" of class Foo as AbstractBar, not Bar.

      Interestingly, a little debugging showed that the getter method for property bar was "public AbstractBar Foo.getBar()" ... in other words, much like with Generics, covariant return types may be largely
      a fiction of the compiler inserting the necessary casts in place.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                thiagohp Thiago H. de Paula Figueiredo
                Reporter:
                hlship Howard M. Lewis Ship
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: