Adds platform specific nullability attributes to CoreLocation

This commit is contained in:
Cosmin Stirbu 2020-05-04 17:30:21 +03:00
Родитель 956228685c
Коммит e164c4d38f
4 изменённых файлов: 6 добавлений и 22 удалений

Просмотреть файл

@ -221,7 +221,7 @@ namespace CoreLocation {
[Availability (Deprecated = Platform.iOS_6_0)] [Availability (Deprecated = Platform.iOS_6_0)]
// Default property value is null but it cannot be set to that value // Default property value is null but it cannot be set to that value
// it crash when a null is provided // it crash when a null is provided
[Export ("purpose")] [NullAllowed, Export ("purpose")]
string Purpose { get; set; } string Purpose { get; set; }
[NoTV] [NoTV]
@ -253,7 +253,7 @@ namespace CoreLocation {
[NoTV] [NoTV]
[Watch (6,0)] [Watch (6,0)]
[Export ("heading", ArgumentSemantic.Copy)] [NullAllowed, Export ("heading", ArgumentSemantic.Copy)]
CLHeading Heading { get; } CLHeading Heading { get; }
#endif #endif
@ -449,7 +449,7 @@ namespace CoreLocation {
[NoWatch][NoTV] [NoWatch][NoTV]
[Export ("locationManager:monitoringDidFailForRegion:withError:"), EventArgs ("CLRegionError")] [Export ("locationManager:monitoringDidFailForRegion:withError:"), EventArgs ("CLRegionError")]
void MonitoringFailed (CLLocationManager manager, CLRegion region, NSError error); void MonitoringFailed (CLLocationManager manager, [NullAllowed] CLRegion region, NSError error);
[NoWatch][NoTV] [NoWatch][NoTV]
[Export ("locationManager:didStartMonitoringForRegion:"), EventArgs ("CLRegion")] [Export ("locationManager:didStartMonitoringForRegion:"), EventArgs ("CLRegion")]
@ -509,7 +509,7 @@ namespace CoreLocation {
[NoWatch][NoTV] [NoWatch][NoTV]
[Export ("locationManager:didFinishDeferredUpdatesWithError:"), EventArgs ("NSError", true)] [Export ("locationManager:didFinishDeferredUpdatesWithError:"), EventArgs ("NSError", true)]
void DeferredUpdatesFinished (CLLocationManager manager, NSError error); void DeferredUpdatesFinished (CLLocationManager manager, [NullAllowed] NSError error);
} }
[Static] [Static]
@ -698,10 +698,10 @@ namespace CoreLocation {
[Export ("UUID", ArgumentSemantic.Copy)] [Export ("UUID", ArgumentSemantic.Copy)]
NSUuid Uuid { get; } NSUuid Uuid { get; }
[Export ("major", ArgumentSemantic.Copy)] [NullAllowed, Export ("major", ArgumentSemantic.Copy)]
NSNumber Major { get; } NSNumber Major { get; }
[Export ("minor", ArgumentSemantic.Copy)] [NullAllowed, Export ("minor", ArgumentSemantic.Copy)]
NSNumber Minor { get; } NSNumber Minor { get; }
[Export ("notifyEntryStateOnDisplay", ArgumentSemantic.Assign)] [Export ("notifyEntryStateOnDisplay", ArgumentSemantic.Assign)]

Просмотреть файл

@ -1,8 +0,0 @@
# Initial result from new rule missing-null-allowed
!missing-null-allowed! 'CoreLocation.CLHeading CoreLocation.CLLocationManager::get_Heading()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'Foundation.NSNumber CoreLocation.CLBeaconRegion::get_Major()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'Foundation.NSNumber CoreLocation.CLBeaconRegion::get_Minor()' is missing an [NullAllowed] on return type
!missing-null-allowed! 'System.Void CoreLocation.CLLocationManager::set_Purpose(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void CoreLocation.CLLocationManagerDelegate::DeferredUpdatesFinished(CoreLocation.CLLocationManager,Foundation.NSError)' is missing an [NullAllowed] on parameter #1
!missing-null-allowed! 'System.Void CoreLocation.CLLocationManagerDelegate::MonitoringFailed(CoreLocation.CLLocationManager,CoreLocation.CLRegion,Foundation.NSError)' is missing an [NullAllowed] on parameter #1

Просмотреть файл

@ -2,8 +2,3 @@
!extra-protocol-member! unexpected selector CLLocationManagerDelegate::locationManagerDidPauseLocationUpdates: found !extra-protocol-member! unexpected selector CLLocationManagerDelegate::locationManagerDidPauseLocationUpdates: found
!extra-protocol-member! unexpected selector CLLocationManagerDelegate::locationManagerDidResumeLocationUpdates: found !extra-protocol-member! unexpected selector CLLocationManagerDelegate::locationManagerDidResumeLocationUpdates: found
!extra-protocol-member! unexpected selector CLLocationManagerDelegate::locationManagerShouldDisplayHeadingCalibration: found !extra-protocol-member! unexpected selector CLLocationManagerDelegate::locationManagerShouldDisplayHeadingCalibration: found
# Initial result from new rule missing-null-allowed
!missing-null-allowed! 'System.Void CoreLocation.CLLocationManager::set_Purpose(System.String)' is missing an [NullAllowed] on parameter #0
!missing-null-allowed! 'System.Void CoreLocation.CLLocationManagerDelegate::DeferredUpdatesFinished(CoreLocation.CLLocationManager,Foundation.NSError)' is missing an [NullAllowed] on parameter #1
!missing-null-allowed! 'System.Void CoreLocation.CLLocationManagerDelegate::MonitoringFailed(CoreLocation.CLLocationManager,CoreLocation.CLRegion,Foundation.NSError)' is missing an [NullAllowed] on parameter #1

Просмотреть файл

@ -1,3 +0,0 @@
# Initial result from new rule missing-null-allowed
!missing-null-allowed! 'CoreLocation.CLHeading CoreLocation.CLLocationManager::get_Heading()' is missing an [NullAllowed] on return type