Questions RE Unsafe Accessors #92568
-
I don't have a .net 8.0 environment so I can't test this out but I have a few questions about this:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
It can, but it does not enable. You can always do such things in reflection.
Yes, JIT specially recognizes them and translates to direct access as the members were public. |
Beta Was this translation helpful? Give feedback.
-
No. But the parameter types do have to match exactly.
It's a runtime error. The member resolution is done at JIT-time, not compile-time. Note that the expected usage is via source generator, where provided you code it correctly you'll always generate the exact required method name, parameter types and modifiers. |
Beta Was this translation helpful? Give feedback.
-
If I have a private method named "set_Value" and I want the function named "Value_Set" is there an attribute I can apply to include the "real" name of the method? |
Beta Was this translation helpful? Give feedback.
You mean like this? The name of the private method is specified using the attribute.