Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Use of generics intertypes

> Cannot make inter-type declarations on type variables, use an interface and
> declare parents public void T.setName() { }

you cannot (currently) make itds on type variables like this:

>     public void T.setName() {... } // error

but you can:

interface Marker {}

public void Marker.setName { ... }

declare parents:  T implements Marker;

But you need to be careful in this area, it does still have a few bugs
I'm afraid...

Andy.


On 12/12/2007, neil loughran <loughran@xxxxxxxxxxxxxxxx> wrote:
> Folks,
>
> I'm investigating the usage of generics in AspectJ and I am really liking
> how it is implemented.  However, one problem I've come across is that of
> generic introductions.
>
> For example, given the abstract aspect below
>
> abstract aspect Foo<T,S> {
>
>     declare parents: T implements Serializable;
>     declare parents: S implements Serializable;
>
>     public void T.setName() {... } // error
>
> }
>
> And the concrete aspect
>
> aspect Test extends Foo<Person,Student> {
>
> }
>
> I get the following error:
>
> Cannot make inter-type declarations on type variables, use an interface and
> declare parents public void T.setName() { }
>
>
> But I'm not entirely sure what this means.  Can anyone advise (sic)...? I'm
> unsure why my original code doesn't work.
>
> Regards
> Neil Loughran
>
>
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top