Unsafe Accessors #7553
Replies: 2 comments 4 replies
-
These are not csharplang questions. This is not part of c# (the language or Roslyn). I recommend maybe asking the runtime. |
Beta Was this translation helpful? Give feedback.
-
No. The signature needs to match (return type and types of the parameters), but the parameter names aren't important.
Everything with this feature is a runtime error. If you do not specify Hopefully with .NET 9 (as it's probably too late to get squeezed in before the .NET 8 release), analyzers will be added by the authors of this feature that report such errors at compile-time.
The proposal (dotnet/runtime#81741) suggests so. It talks about "compile time", but the C# compiler doesn't seem to be involved. Maybe this is an AOT or JIT thing? What's new in .NET 8 doesn't appear to mention it. This is part of the problem with such changes: it affects how we write C# code, but because the language spec doesn't change, it only gets accidently mentioned here. But it doesn't seem to get mentioned as a runtime change either. If it wasn't for someone asking about compile time reflection a few days ago, it could have been months before I stumbled across anything about this feature.
That was always possible via reflection. This just simplifies it. |
Beta Was this translation helpful? Give feedback.
-
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.
All reactions