-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Prefix type names with global and use static TypeSyntax and NameSyntax instead of Parse(Type)Name #90339
Conversation
…x instead of Parse(Type)Name
Tagging subscribers to this area: @dotnet/interop-contrib Issue DetailsFixes #90299 There were a few places where we would use the type names without the global:: prefix that causes issues when there is another "System" symbol in the context. To avoid this, we can use a static TypeSyntax and NameSyntax for well-known types instead of calling ParseTypeName or ParseName and remembering to prefix "global::". Though of course now we need to remember to use these instead of ParseTypeName...
|
...braries/System.Runtime.InteropServices/tests/TestAssets/SharedTypes/ComInterfaces/ISystem.cs
Show resolved
Hide resolved
...ystem.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs
Outdated
Show resolved
Hide resolved
...es/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/SignatureContext.cs
Show resolved
Hide resolved
Looks like there's a few I missed, like Span and ThrowForHR. |
...ystem.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs
Outdated
Show resolved
Hide resolved
...time.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/MarshallerHelpers.cs
Show resolved
Hide resolved
...ibraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGenerator.cs
Show resolved
Hide resolved
Still some code cleanup that can be done, but the generated code looks good and this should probably make it into 8. I'll do the follow up for 9. |
...libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...ystem.Runtime.InteropServices/gen/ComInterfaceGenerator/VirtualMethodPointerStubGenerator.cs
Show resolved
Hide resolved
Failures are known |
Fixes #90299
There were a few places where we would use the type names without the global:: prefix that causes issues when there is another "System" symbol in the context. To avoid this, we can use a static TypeSyntax and NameSyntax for well-known types instead of calling ParseTypeName or ParseName and remembering to prefix "global::". Though of course now we need to remember to use these instead of ParseTypeName...