You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: incorrect nullability annotations in Xamarin.AndroidX.AppCompat 1.8.0 #1558
Xamarin.AndroidX.AppCompat used to have correct C# nullability annotations in version 1.7.1.4, but they're gone in version 1.8.0, resulting in numerous build warnings.
This is not an isolated incident; A similar regression exists for the latest version of AndroidX.Fragment.App (e.g. in Fragment.GetString). My guess is the nullable annotations are not being properly bound from Java.
Steps to Reproduce
Create a project:
dotnet new androidlib
dotnet package add 'Xamarin.AndroidX.AppCompat@1.8.0'
Add the following code:
public class Class1
{
public void X()
{
AndroidX.AppCompat.App.AlertDialog dialog = new AndroidX.AppCompat.App.AlertDialog.Builder(null!).Create();
// Code is valid because the return value of Create() is non-null
}
}
dotnet build and observe the build warnings:
Class1.cs(9,53): warning CS8600: Converting null literal or possible null value to non-nullable type.
Downgrade to 1.7.1.4 and observe the warnings are gone
Activity