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

Refactorings in preparation of .NET 9.0 support #16575

Merged
merged 4 commits into from
Aug 16, 2024
Merged

Conversation

sebastienros
Copy link
Member

@sebastienros sebastienros commented Aug 16, 2024

Changes that would have to be made when supporting .NET 9 and can/should come in 2.0 release instead

  • Formatting
  • Breaking changes on TrimEnd

This way the .NET 9 branch is only about .NET 9 changes

Copy link
Contributor

This pull request has merge conflicts. Please resolve those before requesting a review.

src/docs/releases/2.0.0.md Outdated Show resolved Hide resolved
[ci-skip]

Co-authored-by: Georg von Kries <[email protected]>
@Piedone Piedone merged commit 6347ef1 into main Aug 16, 2024
12 checks passed
@Piedone Piedone deleted the sebros/refactorfor9 branch August 16, 2024 18:18
@@ -356,6 +358,19 @@ public static string TrimEnd(this string value, string trim = "")
? value[..^trim.Length]
: value;
}
#endif

public static string TrimEndString(this string value, string suffix)
Copy link
Member

Choose a reason for hiding this comment

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

Could you please elaborate what are the different behaviors?

In both cases, we can have the same name and move #if .. #elseif .. #endif inside the function, this way no need to have a new method name

Copy link
Member Author

Choose a reason for hiding this comment

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

TrimEnd exists in net9.0, so we need to hide it when we build in net9.0.
And in net9.0 TrimEnd("Part") is equivalent to TrimEnd(new char[] { 'P', 'a', 'r', 't' }) so "MenuListPart" would become "MenuLis" without the t.

Copy link
Member

Choose a reason for hiding this comment

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

Seems a new overload has been added in .NET 9.0

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.

4 participants