Xamarin-android: Nullable Reference Types support

Created on 7 Aug 2018  Â·  4Comments  Â·  Source: xamarin/xamarin-android

C# has a proposal for "nullable reference types": https://github.com/dotnet/csharplang/blob/master/proposals/nullable-reference-types.md

Under this proposal, a string value parameter could not be null, while a string? value parameter could be null.

As It Turns Outâ„¢, Android 9 is getting nullable information as well: https://android-developers.googleblog.com/2018/08/android-pie-sdk-is-now-more-kotlin.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+blogspot%2FhsDu+%28Android+Developers+Blog%29

We should figure out how the Kotlin nullable and non-nullable reference type information is stored (.class file attributes? XML files? other?) and update generator so that we can "forward" that information to a future Mono.Android.dll version.

All 4 comments

any updates on here?

This was recently committed and will be available in 10.3 (16.7/8.7):

https://github.com/xamarin/xamarin-android/pull/4227

Release status update

A new Preview version has now been published that includes the new functionality for this item. The new functionality is not yet included in a Release version. I will update this again when a Release version is available that includes the feature.

New functionality included in Xamarin.Android 10.3.99.230.

New functionality included on Windows in Visual Studio 2019 version 16.7 Preview 1. To try the Preview version that includes the feature, check for the latest updates in Visual Studio Preview.

New functionality included on macOS in Visual Studio 2019 for Mac version 8.7 Preview 1. To try the Preview version that includes the feature, check for the latest updates on the Preview updater channel.

_Release status update_

A new Release version of Xamarin.Android has now been published that includes the new functionality for this item.

New functionality included in Xamarin.Android SDK version 11.0.0.3.

New functionality included on Windows in Visual Studio 2019 version 16.7. To get the new version that includes the feature, check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/.

New functionality included on macOS in Visual Studio 2019 for Mac version 8.7. To get the new version that includes the feature, check for the latest updates on the Stable updater channel.

Was this page helpful?
0 / 5 - 0 ratings