Skip to content
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

Patch for StackOverflow on Recursive Class Definitions. #1408

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

Shabinder
Copy link
Contributor

Shall Fix #1163.

  • Ending Serial Name Description on encountering a recursive descriptor.
  • Have added a test class with a sample recursive class description.
  • Rather than using a placeholder, used class's simple descriptor name.

PS:

  • Allowing Edits by Maintainers if needed.

assertEquals(
expected = "SomeType<" +
"app.cash.zipline.internal.bridge.SomeRecursiveType<" +
"app.cash.zipline.internal.bridge.SomeRecursiveType?<app.cash.zipline.internal.bridge.SomeRecursiveType?>" +
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if it's necessary to include the second copy here. If we break before recursing it won't be included, and isn't it entirely redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JakeWharton you are correct, it does exit, in above:

  1. 1st serialName of Non-Nullable SomeRecursiveType.
  2. 1st serialName of Nullable SomeRecursiveType.
  3. 2nd Recurse serialName of Nullable SomeRecursiveType, hence exits with plain serialName of descriptor.

Copy link
Member

Choose a reason for hiding this comment

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

Right my question was if the second copy is actually necessary or redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AhUnderstood what you mean,
Yes we could just return empty string once we hit recursion instead of repeating serialName, shouldn't matter.

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.

Stack Overflow after 1.2.0, because of shared commit.
2 participants