Skip to content

Mustachio: generate renderer code for mixed in types #2498

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

Merged
merged 4 commits into from
Feb 4, 2021

Conversation

srawlins
Copy link
Member

@srawlins srawlins commented Feb 1, 2021

Also, regenerate renderers with Package visible. The Package class mixes in 4 classes which highlights the solution in this change; each of the 4 mixins gets its own renderer class.

Bringing in these major mixins brings the generated code to 2000 LOCs.

@google-cla google-cla bot added the cla: yes Google CLA check succeeded. label Feb 1, 2021
@coveralls
Copy link

coveralls commented Feb 1, 2021

Coverage Status

Coverage remained the same at 91.611% when pulling 090b298 on srawlins:mustachio-i into 2e3f4bf on dart-lang:master.

@srawlins srawlins requested a review from jcollins-g February 2, 2021 00:08
if (contextClass.mixins != null) {
// Mixins are spread into the property map _after_ the super class, so
// that they override any values which need to be overridden. Superclass
// and mixins override from left to right, as do spreads:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not right to left? (N overrides M, which overrides E). Or am I thinking about this wrongly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm yeah maybe the semantics are meaningless. I mean that mixins are applied left to right. So M is applied, then N is applied, overriding things from M.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes. They are applied left to right, which implies that they override right to left. Implied applies applies implying....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱 😱 😱

@srawlins srawlins merged commit d58b6d5 into dart-lang:master Feb 4, 2021
@srawlins srawlins deleted the mustachio-i branch February 4, 2021 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Google CLA check succeeded.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants