-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Hot Reload: Allow extern functions to be added #73421
Comments
/cc @tmat |
Note these are not P/Invokes. Compare |
The
[UnsafeAccessorAttribute]
(API Proposal) is used onstatic extern
functions to instruct the .NET runtime to generate an accessor method to a type member that bypass the normal .NET visibility checks.With
[UnsafeAccessor]
it becomes possible to use source-generated reflection-free serializers that can serialize and deserialize fields of user-defined classes. For example, a user may add a new field_hidden
toMyClass
and the source generator will add a new accessor method toAccessHelpers
and generate a methodDeserializeMyClass
that uses the access method to populate the hidden field.Currently if the user adds a second private field
_hidden2
and the generator adds a newstatic extern
method, EnC will report a rude edit:Note that both
AccessHelpers
or thestatic extern
method could be generic:The runtime support is tracked in dotnet/runtime#102080
The text was updated successfully, but these errors were encountered: