Skip to content

Add support for C# 14.0 #1340

Description

@NightOwl888

Is there an existing issue for this?

  • I have searched the existing issues

Task description

In both J2N and ICU4N, we have migrated to C# 14.0.

C# 14.0 comes with 2 very important features:

  1. First-class span types allow string to be intrinsically converted to ReadOnlySpan<char> without calling the (slower) .AsSpan() method. This will save us from having to add string overloads just for the sake of cross-target compilation.
  2. Extension members allow us to extend classes with static methods to polyfill methods on legacy target frameworks. For example, we can add string.Concat() overloads that accept ReadOnlySpan<char>.

This is enough motivation for adding support ASAP, since it will drastically shape how we implement support for ReadOnlySpan<char>. Since we already build with the .NET 10 SDK (done in #1222), changing this should be straightforward, although there may be some cleanup required.

We should also do a sweep to ensure:

  • <LangVersion> is only defined at the solution level
  • Any calls to .AsSpan() that can be removed are removed

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions