tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (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
Date Thu, 14 Jul 2016 07:12:21 GMT

    [ https://issues.apache.org/jira/browse/TAP5-1493?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15376460#comment-15376460
] 

ASF subversion and git services commented on TAP5-1493:
-------------------------------------------------------

Commit c2a4b9698993334368359bab2139f4a95a1e56d6 in tapestry-5's branch refs/heads/master from
[~jkemnade]
[ https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;h=c2a4b96 ]

TAP5-2449, TAP5-1493: add the interfaces to the queue in the correct order


> Property expressions on properties that are covariant on a base class use the type of
the base class property, not the covariant subclass
> -----------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1493
>                 URL: https://issues.apache.org/jira/browse/TAP5-1493
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core, tapestry-ioc
>    Affects Versions: 5.2
>            Reporter: Howard M. Lewis Ship
>            Assignee: Thiago H. de Paula Figueiredo
>            Priority: Critical
>              Labels: month-of-tapestry
>             Fix For: 5.4
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message