-
Notifications
You must be signed in to change notification settings - Fork 107
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
Skip interfaces not publicly accessible in authoring scenarios #1394
Skip interfaces not publicly accessible in authoring scenarios #1394
Conversation
symbol is IEventSymbol @event && !@event.ExplicitInterfaceImplementations.IsDefaultOrEmpty) | ||
{ | ||
// If we have a containing type, we also check that it's publicly accessible | ||
return symbol.ContainingType is not { } containingType || containingType.IsPubliclyAccessible(); |
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.
I am trying to understand this, should this have been an &&
rather than a ||
or am I misunderstanding what is not {}
does.
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.
So, is not { }
matches if the expression is not an instance (it's like is null
, but also declares a local). So:
- If
containingType
isnull
, returntrue
- Otherwise (ie.
containingType != null
), returntrue
if it's publicly accessible
If we used &&
, we'd be trying to access containingType
when the first expression already matched, but if that's the case, then containingType
is not defined (because the expression matches on is not
). In fact, if you changed it to &&
, the code would just not compile, as containingType
would be uninitialized in that case 🙂
* Add internal COM interfaces to authoring test * Add MixedWinRTClassicCOM authoring tests * Skip interface types not publicly accessible * Minor code refactoring * Suppress diagnostics for not publicly accessible types * Use fully qualified name for [Guid] to avoid conflicts * Remmove collection expressions in projection attributes * Skip processing explicit members of internal interfaces * Skip processing symbols nested in internal types * Add ABI types for AOT generator * Restore original order/filtering to gather interfaces * Fix build errors in AuthoringConsumptionTest * Add TestMixedWinRTCOMWrapper to activation manifest * Fix unit test * Fix typos in ABI method names
Closes #1369
Overview
This PR updates the WinRT authoring generator to skip interfaces that are not publicly accessible.