Community
Participate
Working Groups
The following aspect issues errors for each of the statements, which it should not: aspect DeclareAnnot { declare @method: * *.get*() || boolean *.is*(): @Annot; declare @field: String *.* || boolean *.* : @Annot; declare @constructor: Person.new() || Person.new(*) : @Annot; declare @method: * *.get*() && boolean *.is*(): @Annot; declare @field: String *.* && boolean *.* : @Annot; declare @constructor: Person.new() && Person.new(*) : @Annot; declare @method: !(* *.get*()): @Annot; declare @field: !(String *.*) : @Annot; declare @constructor: !(Person.new()) : @Annot; } In each of the cases, simple expressions (without ||, &&, or !) work. declare @type works even with ||, &&, or !
Just to add that I tried putting parentheses around individual patterns; that didn't work either.
this is actually working as currently designed. Some reasonably serious changes would be needed to support this extension to the syntax, and the serialized form of the aspect would change as they are currently coded to hold a single ctor/field or method signature pattern, and not a compound pattern.
as 1.6.9 is changing the serialized format, I'm cramming any changes in that also need a change in format. This is now committed. I had to build new infrastructure for handling compound signature patterns and it is only used by declare annotation field/method/constructor. It is a little keen on requiring parentheses, but I don't think that is a big deal. In your example: declare @method: * *.get*() || boolean *.is*(): @Annot; must be expressed as declare @method: (* *.get*()) || (boolean *.is*()): @Annot;