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

Infinite loop in RenamePropertyWithSameNameAsClass #1671

Open
cubed-it opened this issue Jan 30, 2024 · 0 comments
Open

Infinite loop in RenamePropertyWithSameNameAsClass #1671

cubed-it opened this issue Jan 30, 2024 · 0 comments

Comments

@cubed-it
Copy link

Hello, I've discovered an infinite loop in the CSharpGenerator.RenamePropertyWithSameNameAsClass method. The problem arises when a property shares the same name as its enclosing type and another property already bears a '1' suffix:

var number = 1;
var candidate = typeName + number;
while (propertyModels.Any(p => p.PropertyName == candidate))
{
    number++;
}

This loop will persist indefinitely under the described condition.

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

No branches or pull requests

1 participant