-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Warnings for in
/readonly ref
#77625
Comments
Tagging @VSadov |
There are cases where having an In general it is indeed not very useful, but there would be a need for a whitelist of few reasonable uses. |
But they could be #pragma'd as valid? |
I agree this would be a good case for an analyzer. That being said, for some types whether or not it should be passed as 'in' depends on the underlying architecture and calling convention. So the diagnostics should likely only cover the well-defined cases that are consistent between all targets. |
This should be considered for the warning waves dotnet/roslyn#1580 and the code fix candidates dotnet/roslyn#23326. |
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Transferred to dotnet/runtime for triage |
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsPrimitive value-types that will be passed by register ( Reference-types should generate a warning when passed as from: dotnet/roslyn#23327 /cc @mikedn
|
A list of cases that need to be covered would be very helpful for further triaging and implementing the analyzer. For reference types it is suggested to exclude Please comment any exclusions should be covered |
Primitive value-types that will be passed by register (
byte
,short
,int
, etc) should generate a warning when passed asin
as passing by readonly reference in the common case is likely a deoptimization error (dereference vs register)Reference-types should generate a warning when passed as
in
as passing by readonly reference in the common case is likely a deoptimization error (double dereference vs dereference)from: dotnet/roslyn#23327
/cc @mikedn
The text was updated successfully, but these errors were encountered: