Closed Sergio0694 closed 1 year ago
I thought UnsafeAccessor
is not allowed within non .NET 8 binaries?
.NET 8 had released, so is there a plan get this merged?
Of course there is a plan, or this PR wouldn't exist. Just a little bit of patience, this is not my full time job 😅
Note: waiting on https://github.com/actions/runner-images/issues/8797.
Note: waiting on actions/runner-images#8797.
The image seems to be updated now.
Hi @Sergio0694, is the namespace System.Runtime.CompilerServices2
a typo or was it intended for the InlineArrayAttribute
?
It's intended. Roslyn matches the attribute by full name, and will not let you use it if it's in the correct one and the runtime does not support it. So the only way to make that compile is to put it into a different namespace. I'm doing the same for [UnmanagedCallersOnly]
.
@Sergio0694 do you have any insight why InlineArrayAttribute
shows up in my assembly's exported types but the other attributes don't? It's causing some neck pains with other tools which don't like it when I put types in the System
namespace, e.g. https://github.com/dotnet/docfx/issues/9507
Okay I see it's because InlineArrayAttribute
visibility is always public
, ignoring PolySharpUsePublicAccessibilityForGeneratedTypes
. Is that a bug @Sergio0694 ?
It is, yeah. I'll go fix it when I have a minute, good find! 😅
If it's just a matter of changing the visibility and bumping the version, I can make a PR.
Just needs changing the visibility, the version is set automatically by the CI when I create a release branch 🙂
Voila #92
Sorry for the comment spam, but it's insane to me that C# 12 has been out for less than a month and you've already released polyfill support for it.
Thank you so much @Sergio0694 (and collaborators!) for this project.
Description
This PR adds the following polyfills for C# 12 and .NET 8:
[RequiresLocation]
[CollectionBuilder]
[UnsafeAccessor]
[Experimental]
[InlineArray]