Update find-refs to find references to nint/nuint#67139
Update find-refs to find references to nint/nuint#67139CyrusNajmabadi merged 3 commits intodotnet:mainfrom
Conversation
| PredefinedType.String => SpecialType.System_String, | ||
| PredefinedType.DateTime => SpecialType.System_DateTime, | ||
| PredefinedType.IntPtr => SpecialType.System_IntPtr, | ||
| PredefinedType.UIntPtr => SpecialType.System_UIntPtr, |
There was a problem hiding this comment.
last two lines are added.
| { | ||
| void M() | ||
| { | ||
| $${|Reference:nint|} n1 = 1; |
There was a problem hiding this comment.
Why the behavior changes when CommonReferencesNet7=true?
There was a problem hiding this comment.
Oh I just realize this is the design decision of .net 7
There was a problem hiding this comment.
How does this actually work when the runtime is different? (i.e. I am surprised with how this work, are the symbols we get from the compiler side different?)
There was a problem hiding this comment.
So the compiler produces different symbols. They differ with this property:
https://github.com/dotnet/roslyn/blob/main/src/Compilers/Core/Portable/Symbols/ITypeSymbol.cs#L82
On .net7 and above, both of these will return true for IsNativeIntegerType. Prior to .net 7, only nint/nuint would, and IntPtr/UIntPtr would return false.
Cosifne
left a comment
There was a problem hiding this comment.
Some minor questions. Other than that lgtm
Fixes #42988
Properly understands if nint/nuint are true aliases to IntPtr/UIntPtr or not depending on underlying framework.