sigmundch / DEP-member-interceptors

little experiment of using barriers to implement observability
4 stars 4 forks source link

ordering issues with side annotations #10

Open sigmundch opened 9 years ago

sigmundch commented 9 years ago

there is a potential ordering issue with how to combine interceptors that are annotated on the side via @ApplyInterceptorTo

Original comment from @mraleph:

If I import the same library twice into two other different libraries and on both imports I apply interceptors to the same member --- then it's not entirely clear how that should "stack".

Of course there is an obvious order induced by the order of import statements - but this order is somewhat hidden from the programmer.

sigmundch commented 9 years ago

This is an interesting point. Some ideas:

jakemac53 commented 9 years ago

also, how should those be ordered relative to existing annotations?

sigmundch commented 9 years ago

if they exist on the declaration itself, I'd say those always win/apply first.

jakemac53 commented 9 years ago

you can imagine a situation where you needed your SideTag annotation to be first though