You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "NightOwl888 (via GitHub)" <gi...@apache.org> on 2026/06/12 12:19:36 UTC
[I] Add support for C# 14.0 [lucenenet]
NightOwl888 opened a new issue, #1340:
URL: https://github.com/apache/lucenenet/issues/1340
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Task description
In both [J2N](https://github.com/NightOwl888/J2N/issues/172) and [ICU4N](https://github.com/NightOwl888/ICU4N/issues/120), we have migrated to C# 14.0.
C# 14.0 comes with 2 very important features:
1. [First-class span types](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-14.0/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](https://devblogs.microsoft.com/dotnet/csharp-exploring-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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Add support for C# 14.0 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin closed issue #1340: Add support for C# 14.0
URL: https://github.com/apache/lucenenet/issues/1340
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Add support for C# 14.0 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin commented on issue #1340:
URL: https://github.com/apache/lucenenet/issues/1340#issuecomment-4770483130
@NightOwl888 I'm going to mark this fixed once #1374 is merged. If there are any specific examples of extension members that should be added, that can and should be its own issue since it's not specifically about C# 14 or optimizations directly due to it (like removing AsSpan).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Add support for C# 14.0 [lucenenet]
Posted by "paulirwin (via GitHub)" <gi...@apache.org>.
paulirwin commented on issue #1340:
URL: https://github.com/apache/lucenenet/issues/1340#issuecomment-4692411111
+∞
Added to the milestone for the next major beta, due to "ASAP" which I agree with.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org