forked from xamarin/xamarin-macios
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Fix property accessor attributes when one accessor's iOS …
…availability is different than the property itself. (xamarin#17298) This PR handles two scenarios (fixed in separate commits): Scenario 1: * The property has different availability attributes than the containing type. * The property's accessor(s) do not have availability attributes. We'd generate the wrong availability attributes for the property accessors, because we'd take the type's availability attributes and add them to the accessors. As for the fix: I can't really explain it. This code is rather impenetrable, and the parameter names don't make much sense, but whatever I did seems to work? And it turns out this fix shows up in an existing test as well (the generator's Bug35176 test), which I had to modify to remove the expectation of (now redundant) availability attributes that we no longer produce. Scenario 2: * Type is available on iOS, tvOS. * Property in the type is available on iOS (and not tvOS). * Property accessor has explicit availability attributes for iOS. Then the property accessor would get the availability attribute for tvOS from the type, and not the (un)availability attribute from the property. The fix is to make sure the parent context is the property (and not the type) when processing availability attributes for the accessor.
- Loading branch information
1 parent
d27667f
commit a57695b
Showing
9 changed files
with
149 additions
and
86 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.