adl-lang/adl

Overloading annotations

Opened this issue · 1 comments

gmhta commented

The last annotation wins.
This should either be a compiler error or both annotations should be present.
Probably the forma.

struct Survey {
    @UIElement { "elemType" : "Radio" } YNRating rating;
};

annotation  LoginScreen::rating UIElement { "elemType" : "Button" } ;

Different syntax same result.

struct Survey {
    @UIElement { "elemType" : "Radio" } 
    @UIElement { "elemType" : "Button" } 
    YNRating rating;
};

The intention of annotations is that they can be queried by type. So it doesn't make sense for both to be present.

I'm open to it being an error, rather than "last anotation wins".