Skip to content

diagnose generating overload duplicates - review#4

Merged
InsanityCode merged 7 commits into
diagnose-generating-overload-duplicatesfrom
diagnose-generating-overload-duplicates-review
Jun 2, 2024
Merged

diagnose generating overload duplicates - review#4
InsanityCode merged 7 commits into
diagnose-generating-overload-duplicatesfrom
diagnose-generating-overload-duplicates-review

Conversation

@InsanityCode

Copy link
Copy Markdown
Member

requested changes for #2

@FramePerfection FramePerfection left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is effectively the split I had in mind myself, so thank you for executing it.
You may remove the unnecessary linebreaks before merging if you wish, without a need for a re-review.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

.NET 8 introduces EqualityComparer.Create that may be used to replace this class.
Whether this should happen seems mostly like a matter of taste or convenience right now, but I have the feeling that this class may be of use in a wider context in the future.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The generator is no .Net 8, but a .Net Standard 2.0 library.
This function is only available in .Net 8 and .Net 9.

Comment on lines +214 to +215
HashSet<TemplateArgument[]> generatedOverloads
= new HashSet<TemplateArgument[]>(OverloadComparer.instance);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The linebreak here is now superfluous, as the new shortened array type doesn't uselessly deplete the character count of the line like the previous tuple.
No need to change that now, though - superfluous linebreaks are another issue.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment on lines 324 to 327
string ReplaceTemplateArgs(
string text,
((Regex templateParameterRegex, string templateParameterName), ITypeSymbol templateArgument)[] templateArgs
TemplateArgument[] templateArgs
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same as above (presumably, idk how GitHub actually deals with these comments...), those linebreaks don't need to exist with the much shorter type identifier.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@InsanityCode

Copy link
Copy Markdown
Member Author

You may remove the unnecessary linebreaks before merging if you wish, without a need for a re-review.

I guess #1 will undergo some sort of cleanup before merging it into chaos anyways, so we'll just do that there.

@InsanityCode InsanityCode merged commit 225ab1c into diagnose-generating-overload-duplicates Jun 2, 2024
@InsanityCode InsanityCode deleted the diagnose-generating-overload-duplicates-review branch June 2, 2024 09:14
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