Skip to content

Fix: Unsupported maccatalyst attribute is getting applied to child attributes but not accounted parent child attributes merge #7644

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Apr 30, 2025

When an API supported on IOS it also supported by maccatalyst as they are related. To remove implicit maccatalyst support one need to add [UnsupportedOSPlatform (""maccatalyst"")] to the [SupportedOSPlatform (""ios"")]

The [UnsupportedOSPlatform (""maccatalyst"")] applied to the immediate (child) attributes list and removed the implicit maccatalyst support but when child attributes are merged to the parent attributes list this is not accounted and merged list will keep the implicit maccatalyst support. The PR fixes this bug

Fixes #7633

…tributes but not accounted parent child attributes merge
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.84%. Comparing base (d802d62) to head (187216b).
Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##             main    #7644     +/-   ##
=========================================
  Coverage   96.83%   96.84%             
=========================================
  Files        1215     1220      +5     
  Lines      307561   308792   +1231     
  Branches     9513     9554     +41     
=========================================
+ Hits       297842   299050   +1208     
- Misses       7380     7396     +16     
- Partials     2339     2346      +7     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rolfbjarne
Copy link
Member

This regresses the following sample/unit test: rolfbjarne@84ddcbc, it shows:

Diagnostics:
// /0/Test0.cs(22,20): warning CA1416: This call site is reachable on: 'ios', 'macOS/OSX', 'tvos'. 'NativeObjectExtensions.GetHandle(INativeObject)' is only supported on: 'maccatalyst'.

@buyaa-n
Copy link
Contributor Author

buyaa-n commented May 13, 2025

This regresses the following sample/unit test: rolfbjarne@84ddcbc, it shows:

Diagnostics:
// /0/Test0.cs(22,20): warning CA1416: This call site is reachable on: 'ios', 'macOS/OSX', 'tvos'. 'NativeObjectExtensions.GetHandle(INativeObject)' is only supported on: 'maccatalyst'.

Thanks, when implicit maccatalyst support added with [SupportedOSPlatform (""ios"")] is suppressed by [UnsupportedOSPlatform (""maccatalyst"")] current logic removes maccatalyst support version but keeps the platform in the list with empty (null) versions. This empty maccatalyst causing this regression, it shows that we should remove this platform completely. By design child (nested) API could narrow platform support, removing empty maccatalyst will just work as pre this scenario. I have updated the code accordingly and added related tests

@rolfbjarne
Copy link
Member

CC @ViktorHofer @tannergooding, is this something you guys can approve/merge? I (as the bug reporter) can verify the fix works, I've tested it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CA1416 when property accessor is unsupported on Mac Catalyst
2 participants