Skip to content

Fix generated waiters to call the renamed getter when an output member's getter name matches its result class name. - #4001

Open
sbiscigl wants to merge 1 commit into
mainfrom
waiter-result-getter-collision
Open

sbiscigl wants to merge 1 commit into
mainfrom
waiter-result-getter-collision

Conversation

@sbiscigl

Copy link
Copy Markdown
Collaborator

Issue #, if available:

Description of changes:

When an output member's getter would have the same name as the result class, the model generator adds another Get, but the waiter generator didn't. For an operation GetFoo with an output member fooResult:

class GetFooResult {
  inline const FooResult& GetGetFooResult() const { return m_fooResult; }
};

// waiter before, doesn't compile
result.GetFooResult().GetStatus()

// waiter after
result.GetGetFooResult().GetStatus()

Regenerating all clients produces no changes.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sbiscigl
sbiscigl requested a review from wty-Bryant November 13, 2026 18:46
if (getter.equals(resultClassName)) {
getter = "Get" + getter;
}
resultClassName = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

wonder if this null reset for resultClassName is really needed since the TopLevelVisitor creates a new emitter for every result access

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

got rid of it, the right side of a subexpression gets its own emitter now so only the first field can get renamed

…r's getter name matches its result class name.
@sbiscigl
sbiscigl force-pushed the waiter-result-getter-collision branch from 376701f to 73e20e9 Compare November 13, 2026 20:34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants