Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Add C# 8 nullability annotations to bindings #468

Closed

Description

@cosminstirbu

Hello,

Are there any plans to update the Xamarin.Android bindings (and the generator it self) to support C# 8 nullability?

Since Kotlin adoption by Google the Java Android SDK and the AndroidX libraries have been enhanced to expose the @nullable annotation to help Kotlin indicate if it a value can be null or not.

The bindings generator could also leverage the @nullable annotation to expose C# 8 nullable types.

On Xamarin.iOS there is an issue already opened to capture this dotnet/macios#6154 and since I didn't find one for Xamarin.Android I've decided to open one myself.

Thank you,
Cosmin

Activity

  1. jpobst commented on Aug 13, 2019

    @jpobst
    Contributor

    It's something we've started discussing over the past few weeks. Currently we are working on bringing C# 8's default interface methods to Xamarin.Android, as it's a large gap compared to Java we've needed for a long time.

    Nullable reference types is one of the things we are considering after that. It's good to know that the Android SDK has been annotated in a way we should be able to use. That was one of the questions we had that we hadn't explored yet. Obviously that makes the feature much more valuable instead of just marking everything as nullable because we don't actually know.

  2. transferred this issue fromdotnet/androidon Aug 13, 2019
  3. jonpryor commented on Aug 14, 2019

    @jonpryor
    Contributor

    Related: in order to reasonably map the @nullable annotation -- do we know the exact type involved here? Kotlin appears to use org.jetbrains.annotations.NotNull -- we'll need to add support for parsing annotations -- PR #467 is a start, but it only handles types, not parameters -- but also propagate that info into the XML description.

    We'd presumably need RuntimeVisibleParameterAnnotations and RuntimeInvisibleParameterAnnotations parsing support.

  4. mattleibow commented on Aug 14, 2019

    @mattleibow
    Member
  5. removed their assignment
    on Aug 28, 2019
  6. added this to the milestone on Nov 22, 2019
  7. added a commit that references this issue on Dec 2, 2019
  8. modified the milestones: , d16-7 on Apr 6, 2020
  9. added
    enhancementProposed change to current functionality
    generatorIssues binding a Java library (generator, class-parse, etc.)
    on Apr 6, 2020
  10. self-assigned this
    on Apr 8, 2020
  11. locked and limited conversation to collaborators on Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementProposed change to current functionalitygeneratorIssues binding a Java library (generator, class-parse, etc.)

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions