-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
IDE0049 should be updated to suggest converting IntPtr to nint and UIntPtr to nuint. #63421
Comments
Note: we have two analyzers, one that goes from C# aliases to .NET types and one that goes from .NET types to C# aliases. Both should be updated. |
@cston can you point to docs (or give the rules) on precisely when we should consider these types equivalent? |
The compiler treats |
Sounds good. I see tehre is AssemblySYmbol.RuntimeSupportsNumericIntPtr. Could we expose that publicly? |
This also should consider @jkotas suggestion in the original issue:
|
Brief description:
As mentioned in dotnet/runtime#72348 with the numeric IntPtr feature,
nint
is now an alias forSystem.IntPtr
andnuint
is alias forSystem.UIntPtr
, the analyzerIDE0049
should be updated to suggest convertingIntPtr
tonint
andUIntPtr
tonuint
. Preferably default to "Info" level.Languages applicable:
C# only
Additional information:
Related to dotnet/runtime#72348
Documentation requirements:
When this analyzer is updated, the Documentation for IDE0049 analyzers could be updated accordingly.
The text was updated successfully, but these errors were encountered: