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

Breaking Change: Fix argument name in CompareInfo.IsPrefix (suffix -> prefix) #20501

Closed
1 of 22 tasks
jeffhandley opened this issue Sep 8, 2020 · 1 comment · Fixed by #20677
Closed
1 of 22 tasks

Breaking Change: Fix argument name in CompareInfo.IsPrefix (suffix -> prefix) #20501

jeffhandley opened this issue Sep 8, 2020 · 1 comment · Fixed by #20677
Assignees
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release doc-idea Indicates issues that are suggestions for new topics [org][type][category]

Comments

@jeffhandley
Copy link
Member

jeffhandley commented Sep 8, 2020

Fix argument name in CompareInfo.IsPrefix (suffix -> prefix)

This CompareInfo.IsPrefix() API was added in .NET 5.0 RC1, but there is a mistake in the argument name where suffix was used instead of prefix. The implementation is correct, but the reference assembly was wrong. dotnet/runtime#41803 fixed the argument name. This fix will ship with .NET 5.0 RC2.

Version introduced

.NET 5.0 RC2

Old behavior

The previous method signature was the following, with an argument named suffix.

public bool IsPrefix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> suffix, System.Globalization.CompareOptions options, out int matchLength)

New behavior

The updated method signature is the following, with the argument renamed to prefix.

public bool IsPrefix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> prefix, System.Globalization.CompareOptions options, out int matchLength)

Reason for change

This corrects a mistake in the argument name and will improve the API, avoiding confusion by users.

Recommended action

If the argument was being used as a named argument, update calling code to correct the argument name to match the renamed prefix name.

Category

  • ASP.NET Core
  • C#
  • Code analysis
  • Core .NET libraries
  • Cryptography
  • Data
  • Debugger
  • Deployment
  • Globalization
  • Interop
  • JIT
  • LINQ
  • Managed Extensibility Framework (MEF)
  • MSBuild
  • Networking
  • Printing
  • Security
  • Serialization
  • Visual Basic
  • Windows Forms
  • Windows Presentation Foundation (WPF)
  • XML, XSLT

Affected APIs

CompareInfo.IsPrefix(ReadOnlySpan<char>, ReadOnlySpan<char>, CompareOptions, out int)

The affected overload was added in .NET 5.0 RC1 and was not yet present in documentation at the time of this breaking change in RC2.


Issue metadata

  • Issue type: breaking-change
@dotnet-bot dotnet-bot added ⌚ Not Triaged Not triaged breaking-change Indicates a .NET Core breaking change labels Sep 8, 2020
@gewarren gewarren self-assigned this Sep 8, 2020
@gewarren gewarren added doc-idea Indicates issues that are suggestions for new topics [org][type][category] 🏁 Release: .NET 5 Work items for the .NET 5 release and removed ⌚ Not Triaged Not triaged labels Sep 8, 2020
@jeffhandley
Copy link
Member Author

Updated the description to reflect that the breaking change was introduced in 5.0 RC2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release doc-idea Indicates issues that are suggestions for new topics [org][type][category]
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants