-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[generator] Use decl type's @deprecated-since if < member's (#1068)
Context: https://discord.com/channels/732297728826277939/732297837953679412/1052239604905934848 Imagine a type is deprecated in API-25 but its members were not explicitly marked as deprecated: @deprecated public class TabActivity extends ActivityGroup { public void setDefaultTab(String tag) { ... } } Then in API-29 the member is explicitly marked as deprecated: @deprecated public class TabActivity extends ActivityGroup { @deprecated public void setDefaultTab(String tag) { ... } } Due to the way `api-merge` calculates `@deprecated-since`, these would end up with different values, with a resulting C# API: [ObsoletedOSPlatform("android25.0")] public class TabActivity : ActivityGroup { [ObsoletedOSPlatform("android29.0")] public void SetDefaultTab (string tag) { ... } } While technically "fine", it is confusing that the method says it was obsoleted in API-29 instead of API-25. To fix this, if a member has a "higher" `@deprecated-since` value than its declaring type, we set the member's `@deprecated-since` value to the declaring type's `@deprecated-since` value.
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 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