From f53171b289de7f29cc01858bb0ffa9e213d3c01c Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 11 Nov 2022 07:27:02 +0100 Subject: [PATCH 1/3] [generator] Fix warnings in api definitions. appkit.cs(13128,8): warning CS0108: 'NSResponder.RestoreUserActivityState(NSUserActivity)' hides inherited member 'NSUserActivityRestoring.RestoreUserActivityState(NSUserActivity)'. Use the new keyword if hiding was intended. appkit.cs(19500,12): warning CS0109: The member 'NSTextView.Editable' does not hide an accessible member. The new keyword is not required. appkit.cs(19503,12): warning CS0109: The member 'NSTextView.Selectable' does not hide an accessible member. The new keyword is not required. appkit.cs(27481,14): warning CS0108: 'NSFontAssetRequest.Progress' hides inherited member 'NSProgressReporting.Progress'. Use the new keyword if hiding was intended. appkit.cs(5342,8): warning CS0108: 'NSController.DiscardEditing()' hides inherited member 'NSEditor.DiscardEditing()'. Use the new keyword if hiding was intended. appkit.cs(5346,8): warning CS0108: 'NSController.CommitEditing(NSObject, Selector, nint)' hides inherited member 'NSEditor.CommitEditing(NSObject, Selector, nint)'. Use the new keyword if hiding was intended. appkit.cs(5353,8): warning CS0108: 'NSController.ObjectDidBeginEditing(INSEditor)' hides inherited member 'NSEditorRegistration.ObjectDidBeginEditing(INSEditor)'. Use the new keyword if hiding was intended. appkit.cs(5356,8): warning CS0108: 'NSController.ObjectDidEndEditing(INSEditor)' hides inherited member 'NSEditorRegistration.ObjectDidEndEditing(INSEditor)'. Use the new keyword if hiding was intended. appkit.cs(5367,8): warning CS0108: 'NSController.CommitEditing()' hides inherited member 'NSEditor.CommitEditing()'. Use the new keyword if hiding was intended. appkit.cs(5974,8): warning CS0108: 'NSDocument.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)' hides inherited member 'NSUserInterfaceValidations.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)'. Use the new keyword if hiding was intended. appkit.cs(6113,8): warning CS0108: 'NSDocument.RestoreUserActivityState(NSUserActivity)' hides inherited member 'NSUserActivityRestoring.RestoreUserActivityState(NSUserActivity)'. Use the new keyword if hiding was intended. appkit.cs(6260,8): warning CS0108: 'NSDocumentController.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)' hides inherited member 'NSUserInterfaceValidations.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)'. Use the new keyword if hiding was intended. avfoundation.cs(4928,3): warning CS0618: 'AVSampleCursorSyncInfo' is obsolete: 'This API is not available on this platform.' avfoundation.cs(4931,3): warning CS0618: 'AVSampleCursorSyncInfo' is obsolete: 'This API is not available on this platform.' avfoundation.cs(4942,3): warning CS0618: 'AVSampleCursorStorageRange' is obsolete: 'This API is not available on this platform.' avfoundation.cs(4945,3): warning CS0618: 'AVSampleCursorChunkInfo' is obsolete: 'This API is not available on this platform.' avfoundation.cs(4951,3): warning CS0618: 'AVSampleCursorStorageRange' is obsolete: 'This API is not available on this platform.' carplay.cs(1622,8): warning CS0108: 'CPListImageRowItem.Enabled' hides inherited member 'CPListTemplateItem.Enabled'. Use the new keyword if hiding was intended. carplay.cs(1695,8): warning CS0108: 'CPMessageListItem.Enabled' hides inherited member 'CPListTemplateItem.Enabled'. Use the new keyword if hiding was intended. carplay.cs(576,8): warning CS0108: 'CPListItem.Enabled' hides inherited member 'CPListTemplateItem.Enabled'. Use the new keyword if hiding was intended. contacts.cs(1589,3): warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' contacts.cs(1685,3): warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' coredata.cs(1053,12): warning CS0109: The member 'NSManagedObjectContext.Lock()' does not hide an accessible member. The new keyword is not required. coredata.cs(1059,12): warning CS0109: The member 'NSManagedObjectContext.Unlock()' does not hide an accessible member. The new keyword is not required. coredata.cs(2066,12): warning CS0109: The member 'NSPersistentStoreCoordinator.Lock()' does not hide an accessible member. The new keyword is not required. coredata.cs(2072,12): warning CS0109: The member 'NSPersistentStoreCoordinator.Unlock()' does not hide an accessible member. The new keyword is not required. coreimage.cs(1731,88): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. coreimage.cs(1798,81): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. foundation.cs(459,21): error CS0246: The type or namespace name 'NSTextBlock' could not be found (are you missing a using directive or an assembly reference?) foundation.cs(463,21): error CS0246: The type or namespace name 'NSTextTable' could not be found (are you missing a using directive or an assembly reference?) gamecontroller.cs(2422,13): warning CS0108: 'GCDevicePhysicalInput.Device' hides inherited member 'GCDevicePhysicalInputState.Device'. Use the new keyword if hiding was intended. healthkit.cs(4208,237): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. healthkit.cs(4208,247): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. mapkit.cs(1892,12): warning CS0109: The member 'MKTileOverlay.CanReplaceMapContent' does not hide an accessible member. The new keyword is not required. metal.cs(1627,3): warning CS0618: 'MTLAccelerationStructureSizes' is obsolete: 'This API is not available on this platform.' notificationcenter.cs(82,3): warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' PassKit/PKEnums.cs(193,11): warning CS0618: 'PKPaymentButtonType.Checkout' is obsolete: 'Use 'Checkout2'.' PassKit/PKEnums.cs(195,15): warning CS0618: 'PKPaymentButtonType.Book' is obsolete: 'Use 'Book2'.' pdfkit.cs(1454,76): warning CS0618: 'PdfPrintScalingMode' is obsolete: 'This type is not available on iOS.' pdfkit.cs(2020,53): warning CS0618: 'PdfPrintScalingMode' is obsolete: 'This type is not available on iOS.' scenekit.cs(1973,87): warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. sharedwithyou.cs(372,9): warning CS0108: 'SWHighlightChangeEvent.HighlightUrl' hides inherited member 'SWHighlightEvent.HighlightUrl'. Use the new keyword if hiding was intended. soundanalysis.cs(207,4): warning CS0657: 'return' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are 'property'. All attributes in this block will be ignored. uikit.cs(11490,44): warning CS0109: The member 'UIResponder.ActivityItemsConfiguration' does not hide an accessible member. The new keyword is not required. uikit.cs(11505,18): warning CS0109: The member 'UIResponder.TouchBar' does not hide an accessible member. The new keyword is not required. uikit.cs(11509,14): warning CS0108: 'UIResponder.TouchBar' hides inherited member 'NSTouchBarProvider.TouchBar'. Use the new keyword if hiding was intended. uikit.cs(292,3): warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' usernotifications.cs(197,13): warning CS0618: 'UNNotificationInterruptionLevel.Critical' is obsolete: 'Use 'Critical2'.' usernotifications.cs(198,15): warning CS0618: 'UNNotificationInterruptionLevel.TimeSensitive' is obsolete: 'Use 'TimeSensitive2'.' usernotifications.cs(199,14): warning CS0618: 'UNNotificationInterruptionLevel.Active' is obsolete: 'Use 'Active2'.' usernotifications.cs(200,20): warning CS0618: 'UNNotificationInterruptionLevel.Passive' is obsolete: 'Use 'Passive2'.' xkit.cs(2068,15): warning CS0109: The member 'NSCollectionLayoutVisibleItem.Center' does not hide an accessible member. The new keyword is not required. xkit.cs(2073,14): warning CS0109: The member 'NSCollectionLayoutVisibleItem.Bounds' does not hide an accessible member. The new keyword is not required. --- src/PassKit/PKEnums.cs | 2 ++ src/appkit.cs | 24 ++++++++++++++++++++++-- src/avfoundation.cs | 10 ++++++++++ src/btouch.cs | 3 +++ src/carplay.cs | 38 -------------------------------------- src/contacts.cs | 4 ++++ src/coredata.cs | 8 ++++++++ src/coreimage.cs | 4 ++-- src/gamecontroller.cs | 4 ++++ src/healthkit.cs | 2 ++ src/mapkit.cs | 2 ++ src/metal.cs | 2 ++ src/notificationcenter.cs | 2 ++ src/pdfkit.cs | 4 ++++ src/scenekit.cs | 2 +- src/sharedwithyou.cs | 3 --- src/soundanalysis.cs | 2 -- src/uikit.cs | 8 +++++++- src/usernotifications.cs | 2 ++ src/xkit.cs | 4 ++++ 20 files changed, 81 insertions(+), 49 deletions(-) diff --git a/src/PassKit/PKEnums.cs b/src/PassKit/PKEnums.cs index 600875fa844c..c45b710264d0 100644 --- a/src/PassKit/PKEnums.cs +++ b/src/PassKit/PKEnums.cs @@ -189,10 +189,12 @@ public enum PKPaymentButtonType : long { [Mac (12,0), iOS (15,0), Watch (8,0)] Continue = 16, #if !NET +#pragma warning disable 0618 // warning CS0618: 'PKPaymentButtonType.[field]' is obsolete: 'Use '[replacement]'.' [iOS (12,0)] Book2 = Checkout, [iOS (12,0)] Checkout2 = Book, +#pragma warning restore #endif // !NET } diff --git a/src/appkit.cs b/src/appkit.cs index 43da0df42aaf..632875332178 100644 --- a/src/appkit.cs +++ b/src/appkit.cs @@ -5338,22 +5338,30 @@ interface NSController : NSCoding, NSEditorRegistration , NSEditor // Conflict over if CommitEditing is a property or a method. NSViewController has it right so can't "fix" NSEditor to match existing API #endif { +#pragma warning disable 0108 // warning CS0108: 'NSController.DiscardEditing()' hides inherited member 'NSEditor.DiscardEditing()'. Use the new keyword if hiding was intended. [Export ("discardEditing")] void DiscardEditing (); +#pragma warning restore [Export ("commitEditingWithDelegate:didCommitSelector:contextInfo:")] #if NET +#pragma warning disable 0108 // warning CS0108: 'NSController.CommitEditing(NSObject, Selector, nint)' hides inherited member 'NSEditor.CommitEditing(NSObject, Selector, nint)'. Use the new keyword if hiding was intended. void CommitEditing ([NullAllowed] NSObject delegate1, [NullAllowed] Selector didCommitSelector, IntPtr contextInfo); +#pragma warning restore #else void CommitEditingWithDelegate ([NullAllowed] NSObject delegate1, [NullAllowed] Selector didCommitSelector, IntPtr contextInfo); #endif #if NET +#pragma warning disable 0108 // warning CS0108: 'NSController.ObjectDidBeginEditing(INSEditor)' hides inherited member 'NSEditorRegistration.ObjectDidBeginEditing(INSEditor)'. Use the new keyword if hiding was intended. [Export ("objectDidBeginEditing:")] void ObjectDidBeginEditing (INSEditor editor); +#pragma warning restore +#pragma warning disable 0108 // warning CS0108: 'NSController.ObjectDidEndEditing(INSEditor)' hides inherited member 'NSEditorRegistration.ObjectDidEndEditing(INSEditor)'. Use the new keyword if hiding was intended. [Export ("objectDidEndEditing:")] void ObjectDidEndEditing (INSEditor editor); +#pragma warning restore #else [Export ("objectDidBeginEditing:")] void ObjectDidBeginEditing (NSObject editor); @@ -5364,7 +5372,9 @@ interface NSController : NSCoding, NSEditorRegistration [Export ("commitEditing")] #if NET +#pragma warning disable 0108 // warning CS0108: 'NSController.CommitEditing()' hides inherited member 'NSEditor.CommitEditing()'. Use the new keyword if hiding was intended. bool CommitEditing (); +#pragma warning restore #else bool CommitEditing { get; } #endif @@ -5970,8 +5980,10 @@ partial interface NSDocument : NSUserActivityRestoring { // Found in NSUserInterfaceValidations protocol with INSValidatedUserInterfaceItem param but bound originally with NSObject // Adding protocol gave warning 0108 which is unfixable without API break #if NET +#pragma warning disable 0108 // warning CS0108: 'NSDocument.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)' hides inherited member 'NSUserInterfaceValidations.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)'. Use the new keyword if hiding was intended. [Export ("validateUserInterfaceItem:")] bool ValidateUserInterfaceItem (INSValidatedUserInterfaceItem anItem); +#pragma warning restore #else [Export ("validateUserInterfaceItem:")] bool ValidateUserInterfaceItem (NSObject /* must implement NSValidatedUserInterfaceItem */ anItem); @@ -6110,7 +6122,7 @@ partial interface NSDocument : NSUserActivityRestoring { // Should be removed but radar://42781537 - Classes fail to conformsToProtocol despite header declaration [Mac (10,10)] [Export ("restoreUserActivityState:")] - void RestoreUserActivityState (NSUserActivity userActivity); + new void RestoreUserActivityState (NSUserActivity userActivity); #endif [Mac (10,12)] @@ -6256,8 +6268,10 @@ partial interface NSDocumentController : NSWindowRestoration, NSCoding { // Found in NSUserInterfaceValidations protocol with INSValidatedUserInterfaceItem param but bound originally with NSObject // Adding protocol gave warning 0108 which is unfixable without API break #if NET +#pragma warning disable 0108 // warning CS0108: 'NSDocumentController.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)' hides inherited member 'NSUserInterfaceValidations.ValidateUserInterfaceItem(INSValidatedUserInterfaceItem)'. Use the new keyword if hiding was intended. [Export ("validateUserInterfaceItem:")] bool ValidateUserInterfaceItem (INSValidatedUserInterfaceItem anItem); +#pragma warning restore #else [Export ("validateUserInterfaceItem:")] bool ValidateUserInterfaceItem (NSObject /* must implement NSValidatedUserInterfaceItem */ anItem); @@ -13125,7 +13139,7 @@ partial interface NSResponder : NSCoding, NSTouchBarProvider , NSUserActivityRes // Should be removed but radar://42781537 - Classes fail to conformsToProtocol despite header declaration [Mac (10,10)] [Export ("restoreUserActivityState:")] - void RestoreUserActivityState (NSUserActivity userActivity); + new void RestoreUserActivityState (NSUserActivity userActivity); #endif [Mac (10,10,3)] @@ -19496,11 +19510,15 @@ partial interface NSTextView : NSTextInputClient, NSTextLayoutOrientationProvide [Protocolize] NSTextViewDelegate Delegate { get; set; } +#pragma warning disable 0109 // warning CS0109: The member 'NSTextView.Editable' does not hide an accessible member. The new keyword is not required. [Export ("editable")] new bool Editable { [Bind ("isEditable")]get; set; } +#pragma warning restore +#pragma warning disable 0109 // warning CS0109: The member 'NSTextView.Selectable' does not hide an accessible member. The new keyword is not required. [Export ("selectable")] new bool Selectable { [Bind ("isSelectable")]get; set; } +#pragma warning restore [Export ("richText")] bool RichText { [Bind ("isRichText")]get; set; } @@ -27477,8 +27495,10 @@ interface NSFontAssetRequest : INSProgressReporting [Export ("downloadedFontDescriptors", ArgumentSemantic.Copy)] NSFontDescriptor[] DownloadedFontDescriptors { get; } +#pragma warning disable 0108 // warning CS0108: 'NSFontAssetRequest.Progress' hides inherited member 'NSProgressReporting.Progress'. Use the new keyword if hiding was intended. [Export ("progress", ArgumentSemantic.Strong)] NSProgress Progress { get; } +#pragma warning restore [Export ("downloadFontAssetsWithCompletionHandler:")] void DownloadFontAssets (DownloadFontAssetsRequestCompletionHandler completionHandler); diff --git a/src/avfoundation.cs b/src/avfoundation.cs index 1657db51818f..758a42a0de10 100644 --- a/src/avfoundation.cs +++ b/src/avfoundation.cs @@ -4924,11 +4924,15 @@ interface AVSampleCursor : NSCopying { [return: Release] CMFormatDescription CopyCurrentSampleFormatDescription (); +#pragma warning disable 0618 // warning CS0618: 'AVSampleCursorSyncInfo' is obsolete: 'This API is not available on this platform.' [Export ("currentSampleSyncInfo")] AVSampleCursorSyncInfo CurrentSampleSyncInfo { get; } +#pragma warning restore +#pragma warning disable 0618 // warning CS0618: 'AVSampleCursorSyncInfo' is obsolete: 'This API is not available on this platform.' [Export ("currentSampleDependencyInfo")] AVSampleCursorSyncInfo CurrentSampleDependencyInfo { get; } +#pragma warning restore [Mac (10,11)] [Export ("samplesRequiredForDecoderRefresh")] @@ -4938,17 +4942,23 @@ interface AVSampleCursor : NSCopying { [Export ("currentChunkStorageURL")] NSUrl CurrentChunkStorageUrl { get; } +#pragma warning disable 0618 // warning CS0618: 'AVSampleCursorStorageRange' is obsolete: 'This API is not available on this platform.' [Export ("currentChunkStorageRange")] AVSampleCursorStorageRange CurrentChunkStorageRange { get; } +#pragma warning restore +#pragma warning disable 0618 // warning CS0618: 'AVSampleCursorChunkInfo' is obsolete: 'This API is not available on this platform.' [Export ("currentChunkInfo")] AVSampleCursorChunkInfo CurrentChunkInfo { get; } +#pragma warning restore [Export ("currentSampleIndexInChunk")] long CurrentSampleIndexInChunk { get; } +#pragma warning disable 0618 // warning CS0618: 'AVSampleCursorStorageRange' is obsolete: 'This API is not available on this platform.' [Export ("currentSampleStorageRange")] AVSampleCursorStorageRange CurrentSampleStorageRange { get; } +#pragma warning restore #if MONOMAC [NoiOS][NoWatch][NoTV] diff --git a/src/btouch.cs b/src/btouch.cs index 6148f3a01c04..3dc765ee9707 100644 --- a/src/btouch.cs +++ b/src/btouch.cs @@ -636,6 +636,9 @@ void Compile (List arguments, int errorCode) if (Driver.RunCommand (compile_command [0], arguments, null, out var compile_output, true, Driver.Verbosity) != 0) throw ErrorHelper.CreateError (errorCode, $"{compiler} {StringUtils.FormatArguments (arguments)}\n{compile_output}".Replace ("\n", "\n\t")); + var output = string.Join (Environment.NewLine, compile_output.ToString ().Split (new char [] { '\n' }, StringSplitOptions.RemoveEmptyEntries)); + if (!string.IsNullOrEmpty (output)) + Console.WriteLine (output); } static string GetWorkDir () diff --git a/src/carplay.cs b/src/carplay.cs index 2d406c86a47c..da4e45928fff 100644 --- a/src/carplay.cs +++ b/src/carplay.cs @@ -506,9 +506,6 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding { [Export ("initWithText:detailText:image:accessoryImage:accessoryType:")] NativeHandle Constructor ([NullAllowed] string text, [NullAllowed] string detailText, [NullAllowed] UIImage image, [NullAllowed] UIImage accessoryImage, CPListItemAccessoryType accessoryType); - [NullAllowed, Export ("text")] - new string Text { get; } - [NullAllowed, Export ("detailText")] string DetailText { get; } @@ -519,9 +516,6 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding { [Export ("showsDisclosureIndicator")] bool ShowsDisclosureIndicator { get; } - [NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)] - new NSObject UserInfo { get; set; } - [iOS (14, 0)] [Export ("explicitContent")] bool IsExplicitContent { [Bind ("isExplicitContent")] get; set; } @@ -566,14 +560,6 @@ interface CPListItem : CPSelectableListItem, NSSecureCoding { [iOS (14,0)] [Export ("setText:")] void SetText (string text); - - [NullAllowed, iOS (14, 0)] - [Export ("handler", ArgumentSemantic.Copy)] - new CPSelectableListItemHandler Handler { get; set; } - - [iOS (15, 0), MacCatalyst (15,0)] - [Export ("enabled")] - bool Enabled { [Bind ("isEnabled")] get; set; } } [NoWatch, NoTV, NoMac, iOS (12,0)] @@ -1600,26 +1586,12 @@ interface CPListImageRowItem : CPSelectableListItem [NullAllowed, Export ("listImageRowHandler", ArgumentSemantic.Copy)] CPListImageRowItemHandler ListImageRowHandler { get; set; } - [Export ("handler", ArgumentSemantic.Copy)] - [NullAllowed] - new CPSelectableListItemHandler Handler { get; set; } - [Static] [Export ("maximumImageSize")] CGSize MaximumImageSize { get; } [Field ("CPMaximumNumberOfGridImages")] nuint MaximumNumberOfGridImages { get; } - - [NullAllowed, Export ("text")] - new string Text { get; set; } - - [NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)] - new NSObject UserInfo { get; set; } - - [iOS (15, 0), MacCatalyst (15,0)] - [Export ("enabled")] - bool Enabled { [Bind ("isEnabled")] get; set; } } [NoWatch, NoTV, NoMac, iOS (14,0)] @@ -1683,16 +1655,6 @@ interface CPMessageListItem : CPListTemplateItem [Field ("CPMaximumMessageItemImageSize")] CGSize MaximumMessageItemImageSize { get; } - - [NullAllowed, Export ("text")] - new string Text { get; set; } - - [NullAllowed, Export ("userInfo", ArgumentSemantic.Strong)] - new NSObject UserInfo { get; set; } - - [iOS (15, 0), MacCatalyst (15,0)] - [Export ("enabled")] - bool Enabled { [Bind ("isEnabled")] get; set; } } [NoWatch, NoTV, NoMac, iOS (14,0)] diff --git a/src/contacts.cs b/src/contacts.cs index 7f2ffe13c3e7..2ea24e07a8af 100644 --- a/src/contacts.cs +++ b/src/contacts.cs @@ -1586,7 +1586,9 @@ interface CNContactVCardSerialization { #if !NET [iOS (9,0), Mac (10,11)] +#pragma warning disable 0618 // warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' [Category (allowStaticMembers: true)] +#pragma warning disable [BaseType (typeof (CNContainer))] interface CNContainer_PredicatesExtension { @@ -1682,7 +1684,9 @@ interface CNErrorUserInfoKey { #if !NET [iOS (9,0), Mac (10,11)] +#pragma warning disable 0618 // warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' [Category (allowStaticMembers: true)] +#pragma warning disable [BaseType (typeof (CNGroup))] interface CNGroup_PredicatesExtension { diff --git a/src/coredata.cs b/src/coredata.cs index e77a5e4afe35..569c19cd3b03 100644 --- a/src/coredata.cs +++ b/src/coredata.cs @@ -1046,17 +1046,21 @@ interface NSManagedObjectContext : NSCoding [Export ("save:")] bool Save (out NSError error); +#pragma warning disable 0109 // warning CS0109: The member 'NSManagedObjectContext.Lock()' does not hide an accessible member. The new keyword is not required. [NoWatch][NoTV] [Deprecated (PlatformName.iOS, 8, 0, message : "Use a queue style context and 'PerformAndWait' instead.")] [Deprecated (PlatformName.MacOSX, 10, 10, message : "Use a queue style context and 'PerformAndWait' instead.")] [Export ("lock")] new void Lock (); +#pragma warning restore +#pragma warning disable 0109 // warning CS0109: The member 'NSManagedObjectContext.Unlock()' does not hide an accessible member. The new keyword is not required. [NoWatch][NoTV] [Deprecated (PlatformName.iOS, 8, 0, message : "Use a queue style context and 'PerformAndWait' instead.")] [Deprecated (PlatformName.MacOSX, 10, 10, message : "Use a queue style context and 'PerformAndWait' instead.")] [Export ("unlock")] new void Unlock (); +#pragma warning restore [NoWatch][NoTV] [Deprecated (PlatformName.iOS, 8, 0, message : "Use a queue style context and 'Perform' instead.")] @@ -2059,17 +2063,21 @@ partial interface NSPersistentStoreCoordinator [return: NullAllowed] NSManagedObjectID ManagedObjectIDForURIRepresentation (NSUrl url); +#pragma warning disable 0109 // warning CS0109: The member 'NSManagedObjectContext.Lock()' does not hide an accessible member. The new keyword is not required. [NoWatch][NoTV] [Deprecated (PlatformName.iOS, 8, 0, message: "Use 'PerformAndWait' instead.")] [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use 'PerformAndWait' instead.")] [Export ("lock")] new void Lock (); +#pragma warning restore +#pragma warning disable 0109 // warning CS0109: The member 'NSManagedObjectContext.Unlock()' does not hide an accessible member. The new keyword is not required. [NoWatch][NoTV] [Deprecated (PlatformName.iOS, 8, 0, message: "Use 'PerformAndWait' instead.")] [Deprecated (PlatformName.MacOSX, 10, 10, message: "Use 'PerformAndWait' instead.")] [Export ("unlock")] new void Unlock (); +#pragma warning restore [NoWatch][NoTV] [Deprecated (PlatformName.iOS, 8, 0, message: "Use 'Perform' instead.")] diff --git a/src/coreimage.cs b/src/coreimage.cs index 332e7314bd3f..2c02d882c48e 100644 --- a/src/coreimage.cs +++ b/src/coreimage.cs @@ -1728,7 +1728,7 @@ interface CIImage : NSSecureCoding, NSCopying { [Static] [Wrap ("FromData (data, options.GetDictionary ())")] [return: NullAllowed] - CIImage FromData (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata? options); + CIImage FromData (NSData data, [NullAllowed] CIImageInitializationOptionsWithMetadata options); [Static] [iOS(9,0)] @@ -1795,7 +1795,7 @@ interface CIImage : NSSecureCoding, NSCopying { [Mac (10,13)] [Static] [Wrap ("FromSurface (surface, options.GetDictionary ())")] - CIImage FromSurface (IOSurface.IOSurface surface, CIImageInitializationOptions? options); + CIImage FromSurface (IOSurface.IOSurface surface, CIImageInitializationOptions options); [Static] [Export ("imageWithColor:")] diff --git a/src/gamecontroller.cs b/src/gamecontroller.cs index 2dd8369e8d85..0d1ac23480b6 100644 --- a/src/gamecontroller.cs +++ b/src/gamecontroller.cs @@ -2417,9 +2417,13 @@ interface IGCDevicePhysicalInput {} [Mac (13,0), iOS (16,0), MacCatalyst (16,0), NoWatch, TV (16,0)] [Protocol] interface GCDevicePhysicalInput : GCDevicePhysicalInputState { +#if !XAMCORE_5_0 +#pragma warning disable 0108 // warning CS0108: 'GCDevicePhysicalInput.Device' hides inherited member 'GCDevicePhysicalInputState.Device'. Use the new keyword if hiding was intended. [Abstract] [NullAllowed, Export ("device", ArgumentSemantic.Weak)] IGCDevice Device { get; } +#pragma warning restore +#endif [Abstract] [NullAllowed, Export ("elementValueDidChangeHandler", ArgumentSemantic.Copy)] diff --git a/src/healthkit.cs b/src/healthkit.cs index de66ad65c6fc..e71ba30dc324 100644 --- a/src/healthkit.cs +++ b/src/healthkit.cs @@ -4205,7 +4205,9 @@ interface HKVerifiableClinicalRecordQuery [iOS (15,4)] [Export ("initWithRecordTypes:sourceTypes:predicate:resultsHandler:")] +#pragma warning disable 8632 // warning CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. IntPtr Constructor (string [] recordTypes, [BindAs (typeof (HKVerifiableClinicalRecordSourceType []))] NSString [] sourceTypes, [NullAllowed] NSPredicate predicate, Action resultsHandler); +#pragma warning restore } [NoWatch, iOS (15,0), Mac (13,0)] diff --git a/src/mapkit.cs b/src/mapkit.cs index cdc872a2ae57..054a2ddd7a5b 100644 --- a/src/mapkit.cs +++ b/src/mapkit.cs @@ -1888,8 +1888,10 @@ partial interface MKTileOverlay : MKOverlay { [NullAllowed] string URLTemplate { get; } +#pragma warning disable 0109 // warning CS0109: The member 'MKTileOverlay.CanReplaceMapContent' does not hide an accessible member. The new keyword is not required. [Export ("canReplaceMapContent")] new bool CanReplaceMapContent { get; set; } +#pragma warning restore [Export ("URLForTilePath:")] NSUrl URLForTilePath (MKTileOverlayPath path); diff --git a/src/metal.cs b/src/metal.cs index 435b197e0c14..3d952c643f45 100644 --- a/src/metal.cs +++ b/src/metal.cs @@ -1624,7 +1624,9 @@ partial interface MTLDevice { [Abstract] #endif [Export ("accelerationStructureSizesWithDescriptor:")] +#pragma warning disable 0618 // warning CS0618: 'MTLAccelerationStructureSizes' is obsolete: 'This API is not available on this platform.' MTLAccelerationStructureSizes CreateAccelerationStructureSizes (MTLAccelerationStructureDescriptor descriptor); +#pragma warning restore [Mac (11,0), iOS (14,0), NoTV] #if NET diff --git a/src/notificationcenter.cs b/src/notificationcenter.cs index 7a4d82ce2167..c99d24d6e471 100644 --- a/src/notificationcenter.cs +++ b/src/notificationcenter.cs @@ -79,7 +79,9 @@ bool WidgetAllowsEditing { [Internal] [Category] #else +#pragma warning disable 0618 // warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' [Category (allowStaticMembers: true)] // Classic isn't internal so we need this +#pragma warning restore #endif interface UIVibrancyEffect_NotificationCenter { [Internal] diff --git a/src/pdfkit.cs b/src/pdfkit.cs index 0db5320ab46c..0d341af3e173 100644 --- a/src/pdfkit.cs +++ b/src/pdfkit.cs @@ -1451,7 +1451,9 @@ interface PdfDocument : NSCopying { [NoiOS] [Export ("printOperationForPrintInfo:scalingMode:autoRotate:")] [return: NullAllowed] +#pragma warning disable 0618 // 'PdfPrintScalingMode' is obsolete: 'This type is not available on iOS.' NSPrintOperation GetPrintOperation ([NullAllowed] NSPrintInfo printInfo, PdfPrintScalingMode scaleMode, bool doRotate); +#pragma warning restore } [iOS (11,0)] @@ -2017,7 +2019,9 @@ interface PdfView : [NoiOS] [Export ("printWithInfo:autoRotate:pageScaling:")] +#pragma warning disable // 0618: 'PdfPrintScalingMode' is obsolete: 'This type is not available on iOS.' void Print (NSPrintInfo printInfo, bool doRotate, PdfPrintScalingMode scaleMode); +#pragma warning restore [Export ("pageForPoint:nearest:")] [return: NullAllowed] diff --git a/src/scenekit.cs b/src/scenekit.cs index daf75c84489c..d7890a21f6c8 100644 --- a/src/scenekit.cs +++ b/src/scenekit.cs @@ -1970,7 +1970,7 @@ interface SCNNode : SCNAnimatable, SCNBoundingVolume, SCNActionable, NSCopying, SCNHitTestResult [] HitTest (SCNVector3 pointA, SCNVector3 pointB, [NullAllowed] NSDictionary options); [Wrap ("HitTest (pointA, pointB, options.GetDictionary ())")] - SCNHitTestResult [] HitTest (SCNVector3 pointA, SCNVector3 pointB, SCNHitTestOptions? options); + SCNHitTestResult [] HitTest (SCNVector3 pointA, SCNVector3 pointB, [NullAllowed] SCNHitTestOptions options); [Mac (10,10)] [Export ("eulerAngles")] diff --git a/src/sharedwithyou.cs b/src/sharedwithyou.cs index 9cf17b3146fb..4342fb0dfd1b 100644 --- a/src/sharedwithyou.cs +++ b/src/sharedwithyou.cs @@ -367,9 +367,6 @@ interface SWHighlightChangeEvent : SWHighlightEvent [Export ("initWithHighlight:trigger:")] NativeHandle Constructor (SWHighlight highlight, SWHighlightChangeEventTrigger trigger); - - [Export ("highlightURL", ArgumentSemantic.Copy)] - NSUrl HighlightUrl { get; } } [NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] diff --git a/src/soundanalysis.cs b/src/soundanalysis.cs index 1c37b8772fa6..338ae94bf5f3 100644 --- a/src/soundanalysis.cs +++ b/src/soundanalysis.cs @@ -203,8 +203,6 @@ interface SNTimeDurationConstraint /* privately conforms to NSCoding, NSCopying, #if NET [BindAs (typeof (CMTime[]))] -#else - [return: BindAs (typeof (CMTime[]))] #endif [Export ("enumeratedDurations", ArgumentSemantic.Strong)] NSValue[] EnumeratedDurations { get; } diff --git a/src/uikit.cs b/src/uikit.cs index db5672d1d398..af9c36247fdc 100644 --- a/src/uikit.cs +++ b/src/uikit.cs @@ -289,7 +289,9 @@ public enum UISearchControllerScopeBarActivation : long { #if !XAMCORE_3_0 [NoWatch] +#pragma warning disable 0618 // warning CS0618: 'CategoryAttribute.CategoryAttribute(bool)' is obsolete: 'Inline the static members in this category in the category's class (and remove this obsolete once fixed)' [Category (allowStaticMembers: true)] // Classic isn't internal so we need this +#pragma warning restore [BaseType (typeof (NSAttributedString))] interface NSAttributedStringAttachmentConveniences { [Internal] @@ -11483,9 +11485,11 @@ interface UIResponder : UIAccessibilityAction, UIAccessibilityFocus, UIUserActiv // from UIResponder (UIActivityItemsConfiguration) +#pragma warning disable 0109 // warning CS0109: The member 'UIResponder.ActivityItemsConfiguration' does not hide an accessible member. The new keyword is not required. [NoWatch, NoTV, iOS (13, 0)] [NullAllowed, Export ("activityItemsConfiguration", ArgumentSemantic.Strong)] new IUIActivityItemsConfigurationReading ActivityItemsConfiguration { get; set; } +#pragma warning restore // from UIResponder (UICaptureTextFromCameraSupporting) [TV (15,0), iOS (15,0), MacCatalyst (15,0)] @@ -11498,11 +11502,13 @@ interface UIResponder : UIAccessibilityAction, UIAccessibilityFocus, UIUserActiv [return: NullAllowed] NSTouchBar CreateTouchBar (); +#pragma warning disable 0108 // warning CS0108: 'NSFontAssetRequest.Progress' hides inherited member 'NSProgressReporting.Progress'. Use the new keyword if hiding was intended. [MacCatalyst (13, 0)] [NoWatch, NoTV, NoiOS] [Export ("touchBar", ArgumentSemantic.Strong)] [NullAllowed] - new NSTouchBar TouchBar { get; set; } + NSTouchBar TouchBar { get; set; } +#pragma warning restore } [NoWatch] diff --git a/src/usernotifications.cs b/src/usernotifications.cs index 4e1e27ee6188..5b0c39a51188 100644 --- a/src/usernotifications.cs +++ b/src/usernotifications.cs @@ -194,10 +194,12 @@ public enum UNNotificationInterruptionLevel : long // Additional enum values to fix reordering - to be at the end of the enum #if !XAMCORE_5_0 +#pragma warning disable 0618 // warning CS0618: 'UNNotificationInterruptionLevel.[field]' is obsolete: 'Use '[replacement]'.' Active2 = Critical, Critical2 = TimeSensitive, Passive2 = Active, TimeSensitive2 = Passive, +#pragma warning restore #endif // !XAMCORE_5_0 } diff --git a/src/xkit.cs b/src/xkit.cs index 6c2fc8eb00f7..da3753d43747 100644 --- a/src/xkit.cs +++ b/src/xkit.cs @@ -2061,16 +2061,20 @@ interface NSCollectionLayoutVisibleItem [Export ("hidden")] bool Hidden { [Bind ("isHidden")] get; set; } +#pragma warning disable 0109 // warning CS0109: The member 'NSCollectionLayoutVisibleItem.Center' does not hide an accessible member. The new keyword is not required. // Inherited from UIDynamicItem for !MONOMAC [NoiOS][NoMacCatalyst][NoWatch][NoTV] [Abstract] [Export ("center", ArgumentSemantic.Assign)] new CGPoint Center { get; set; } +#pragma warning restore +#pragma warning disable 0109 // warning CS0109: The member 'NSCollectionLayoutVisibleItem.Bounds' does not hide an accessible member. The new keyword is not required. [NoiOS][NoMacCatalyst][NoWatch][NoTV] [Abstract] [Export ("bounds")] new CGRect Bounds { get; } +#pragma warning restore [NoMac] [Abstract] From 4e2c4d25af24bebf57e0db939c7b78d9860ed855 Mon Sep 17 00:00:00 2001 From: GitHub Actions Autoformatter Date: Fri, 11 Nov 2022 17:36:18 +0000 Subject: [PATCH 2/3] Auto-format source code --- tests/monotouch-test/AudioUnit/AudioUnitTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/monotouch-test/AudioUnit/AudioUnitTest.cs b/tests/monotouch-test/AudioUnit/AudioUnitTest.cs index 3471c104e88e..5827f4b50d03 100644 --- a/tests/monotouch-test/AudioUnit/AudioUnitTest.cs +++ b/tests/monotouch-test/AudioUnit/AudioUnitTest.cs @@ -84,7 +84,7 @@ public void CopyIconTest () } [Test] - public unsafe void TestSizeOf() + public unsafe void TestSizeOf () { Assert.AreEqual (sizeof (AudioFormat), Marshal.SizeOf (typeof (AudioFormat))); Assert.AreEqual (sizeof (AudioValueRange), Marshal.SizeOf (typeof (AudioValueRange))); From 8a6f7ace3a966ff341b177f2f7cf4e08ae42e818 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Mon, 14 Nov 2022 16:50:44 +0100 Subject: [PATCH 3/3] Reintroduce a few API. --- src/carplay.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/carplay.cs b/src/carplay.cs index da4e45928fff..2cdb2a99e558 100644 --- a/src/carplay.cs +++ b/src/carplay.cs @@ -1592,6 +1592,9 @@ interface CPListImageRowItem : CPSelectableListItem [Field ("CPMaximumNumberOfGridImages")] nuint MaximumNumberOfGridImages { get; } + + [NullAllowed, Export ("text")] + new string Text { get; set; } } [NoWatch, NoTV, NoMac, iOS (14,0)] @@ -1655,6 +1658,9 @@ interface CPMessageListItem : CPListTemplateItem [Field ("CPMaximumMessageItemImageSize")] CGSize MaximumMessageItemImageSize { get; } + + [NullAllowed, Export ("text")] + new string Text { get; set; } } [NoWatch, NoTV, NoMac, iOS (14,0)]