Skip to content

Restore AppCompat and Fragment nullability annotations - #1559

Closed
jonathanpeppers with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-nullability-annotations
Closed

jonathanpeppers with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-nullability-annotations

Conversation

Copilot AI commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

AppCompat 1.8.0 and recent Fragment bindings lose upstream JSpecify non-null annotations, causing CS8600 warnings for valid assignments such as AlertDialog.Builder.Create() and Fragment.GetString().

  • Binding contracts
    • Add scoped metadata preserving JSpecify NonNull annotations in AppCompat, AppCompat Resources, and Fragment.
    • Preserve explicitly nullable parameters and return values.
  • Package updates
    • Bump AppCompat and AppCompat Resources to 1.8.0.1, and Fragment to 1.9.1.1.
    • Update public API snapshots and package metadata.
  • Regression coverage
    • Add compiler coverage for non-null results and nullable inputs.

These assignments should no longer produce CS8600:

AlertDialog dialog = new AlertDialog.Builder(context).Create();
string text = fragment.GetString(resourceId);

Copilot AI and others added 2 commits October 10, 2026 19:22
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix nullability annotations in Xamarin.AndroidX.AppCompat 1.8.0 Restore AppCompat and Fragment nullability annotations Oct 10, 2026
Copilot AI requested a review from jonathanpeppers October 10, 2026 19:40

@jonathanpeppers jonathanpeppers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is an incorrect fix, we could consider backporting this to .NET 10 instead:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: incorrect nullability annotations in Xamarin.AndroidX.AppCompat 1.8.0

2 participants