microsoft/kernel-memory

[Question] Support for C# 12

marcominerva opened this issue · 3 comments

Context / Scenario

With the removing of .NET Standard compatibility (see 5fcae7b), now all the projects target .NET 8.0. But, in the Directory.Build.props file, the LangVerson is still set to v11:

<LangVersion>11</LangVersion>

Question

Is it now possible to switch to C# 12?

dluc commented

I think so, if it helps and doesn't make the code harder to read. I would avoid things like interceptors, new ways to use ref, new ways to access arrays by index. It's also paramount to be well supported across IDEs, VS Code, Rider, Resharper included.

Any feature in particular, aside from inline arrays/collection expressions?

I was mainly thinking about collection expressions to avoid repetitive code :) And also the spread operator can be useful, but depends on the scenario.

dluc commented

done