-
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
Implement basic (recommended against) support for inheriting from COM interfaces defined in different assemblies #105119
Merged
jkoritzinsky
merged 8 commits into
dotnet:main
from
jkoritzinsky:no-cross-syntax-tree-warning
Aug 6, 2024
Merged
Implement basic (recommended against) support for inheriting from COM interfaces defined in different assemblies #105119
jkoritzinsky
merged 8 commits into
dotnet:main
from
jkoritzinsky:no-cross-syntax-tree-warning
Aug 6, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… interfaces defined in different assemblies
jkoritzinsky
added
area-System.Runtime.InteropServices
source-generator
Indicates an issue with a source generator feature
labels
Jul 18, 2024
This was referenced Jul 19, 2024
@dotnet/appmodel PTAL |
AaronRobinsonMSFT
approved these changes
Jul 30, 2024
src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceInfo.cs
Show resolved
Hide resolved
elinor-fung
approved these changes
Jul 31, 2024
src/libraries/System.Runtime.InteropServices/gen/Common/Resources/Strings.resx
Outdated
Show resolved
Hide resolved
...ystem.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/TargetSignatureTests.cs
Show resolved
Hide resolved
This was referenced Jul 31, 2024
/ba-g failure unrelated |
jkoritzinsky
added a commit
to dotnet/docs
that referenced
this pull request
Aug 6, 2024
…ross assembly boundaries Add documentation about the feature introduced in dotnet/runtime#105119
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-System.Runtime.InteropServices
source-generator
Indicates an issue with a source generator feature
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #102602
This PR provides support for simple scenarios of interface inheritance across different assemblies. Using this feature emits a user-suppressible warning with pointers to our (to be updated) documentation.
This feature may not work in advanced scenarios. We expect that the majority of usage of the COM source generator will not use this feature, so that is okay. The following are some scenarios that may not work today or in the future:
Additionally, having a COM interface inheritance chain defined across assemblies causes problems with assembly versioning and creates a really bad pit of failure if the author violates the rules of COM and changes the vtable of their COM interface type (see #102602 (comment)).
We believe that for the amount of usage we expect for this feature, providing an effectively "opt-in and agree to the pitfalls" experience provides the necessary guardrails to avoid guiding users into a pit of failure.