-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change the specified augmentation library structure for macros #3359
Conversation
When there are multiple augmentations of the same type declaration, they are | ||
merged into a single `augment <type> {}` block. This is easier for end users to | ||
understand. This includes multiple augmentations of the _same_ declaration, they | ||
should appear as separate declarations within the same type augmentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what the first statement means. If there are two macros that augment a class A
by adding methods foo
and bar
, we get a single augmentation.
augment class A {
void foo() {}
void bar() {}
}
I don't understand what the last statement means. Could you give an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second example means if you are augmenting foo
multiple times, we put those in the same augment <type> {}
declaration:
augment class A {
augment void foo() {}
augment void foo() {}
augment void foo() {}
augment void foo() {}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the augmentation library proposal might need to be updated to explicitly allow this, I think it might be ambiguous today.
I pushed several examples, and removed the existing example which was not actually relevant any longer (it was based on the appending strategy). |
This moves us to a more user friendly format (all augmentations for a single type grouped together), and removes the incorrect statements about source offset stability.
Closes #3350