Technically, this is not an answer.
First, according to the specs, IsByRefLike
is for the compiler, not for the developers to use: https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.isbyreflikeattribute?view=netframework-4.7.2
Second, when we do want something from a compiler, then it is crucial that we do understand what we want from it. So a correct question could be: I need ABC because I need to do XYZ, where ABC
would be something related to IsByRefLike
and then XYZ
would be something based on IsByRefLike
. The question does not explain why IsByRefLike
is needed.
I think that a minimalist approach should be always weighted in when considering which language features to use / not to use: do we really need some particular language feature to accomplish what we need? F# Option.bind
comes to mind: if the function is a one-liner then Option.bind
is great. However, if there is some tree of how to parse the result, then it might be better to do that explicitly without using Option.bind
.
So the questions are:
- Do you really need
IsByRefLike
?
- If you think that you do, could you, please, post an example of where you actually do need it.