and fixes the ones that have some.
From https://github.com/xamarin/xamarin-macios/issues/9724
We do not _normally_ add availability attributes on enums **members** that represent error codes. In part because it's a lot of metadata and, foremost, because it's not really helpful to write code. E.g.
```csharp
var err = Call.Api (1);
switch (err) {
case NSError.Bad:
case NSError.Wrong:
Console.WriteLine ($"API failed: {err});
break;
case NSError.Ok:
break;
default:
Console.WriteLine ($"Unknown error code {err}");
break;
}
```
Adding version checks inside this would be complicated (source wise) and not really helpful since
* API can return undefined error code (and the error logic should work);
* Availability information is not 100% accurate;
As such we default to not add them - but we some time forgot about it. An intro rule could easily ensure we don't add them needlessly.
It's way too easy to forget that attributes like `[NoiOS]` means the code
is not generated (for bindings) on that platform but that they will be
compiled for _manual_ bindings (not run thru the generator).
This can expose types (and API) that are not usable on some platforms.
This new test checks that the `[No*]` and `[Unavailable]` attributes
are not in their respective platform assemblies.
For compatibility (existing mistakes) we ignore the check on API that
are decorated with `[Obsolete]` attributes.
Changes in the bindings are fix such mistakes - mostly adding the
`[Obsolete]` attribute.
Fix https://github.com/xamarin/xamarin-macios/issues/4835
backport of https://github.com/xamarin/xamarin-macios/pull/9686
Goals
* Reflect Apple nullability annotations in our bindings using C#8
* No warnings when building bindings
Non-Goals
* Update (add or fix) `[NullAllowed]` to match Apple headers (next phase)
* Make the generator or internal code fully nullable aware (`nowarn` is used)
Notes
* Apple's own annotations are not 100% accurate :(
* Where known issue exists we have _fixed_ our attributes to match reality :)
* We also do additional null-checks internally that might seems not required (better safe than sorry).
Only one to start... it's been discussed before but we generally
found other ways to do them. Let's continue to pick the best place
but we now have more options :)