Skip to main content

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

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






Back to the top