-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xtro] Report missing-protocol-conformance when protocols are defined… #3187
Changes from 15 commits
d9c3c68
d9ce8eb
0f00cb1
b641107
75e4646
a391212
9b80dc8
90d1d8e
6996ac0
6268870
ac6346e
cd007c3
57ef7c4
fc3aee5
e942535
4fe8324
94bb764
0f89482
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4205,11 +4205,7 @@ interface AVAssetCache | |
[BaseType (typeof (AVAsset), Name="AVURLAsset")] | ||
// 'init' returns NIL | ||
[DisableDefaultCtor] | ||
interface AVUrlAsset { | ||
|
||
[TV (10, 2), Mac (10, 12, 4), iOS (10, 3)] | ||
[Export ("mayRequireContentKeysForMediaDataProcessing")] | ||
bool MayRequireContentKeysForMediaDataProcessing { get; } | ||
interface AVUrlAsset : AVContentKeyRecipient { | ||
|
||
[Export ("URL", ArgumentSemantic.Copy)] | ||
NSUrl Url { get; } | ||
|
@@ -11517,7 +11513,13 @@ interface AVSampleBufferDisplayLayer { | |
bool ReadyForMoreMediaData { [Bind ("isReadyForMoreMediaData")] get; } | ||
|
||
[Export ("enqueueSampleBuffer:")] | ||
void Enqueue (CMSampleBuffer sampleBuffer); | ||
|
||
#if !XAMCORE_4_0 | ||
[Wrap ("Enqueue (sampleBuffer)", IsVirtual = true)] | ||
[Obsolete ("Use the 'Enqueue' method instead.")] | ||
void EnqueueSampleBuffer (CMSampleBuffer sampleBuffer); | ||
#endif | ||
|
||
[Export ("flush")] | ||
void Flush (); | ||
|
@@ -11526,11 +11528,22 @@ interface AVSampleBufferDisplayLayer { | |
void FlushAndRemoveImage (); | ||
|
||
[Export ("requestMediaDataWhenReadyOnQueue:usingBlock:")] | ||
void RequestMediaData (DispatchQueue queue, Action handler); | ||
|
||
#if !XAMCORE_4_0 | ||
[Wrap ("RequestMediaData (queue, enqueuer)", IsVirtual = true)] | ||
[Obsolete ("Use the 'RequestMediaData' method instead.")] | ||
void RequestMediaDataWhenReadyOnQueue (DispatchQueue queue, Action enqueuer); | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same ;) |
||
|
||
[Export ("stopRequestingMediaData")] | ||
void StopRequestingMediaData (); | ||
|
||
|
||
// TODO: Remove (alongside others) when https://github.com/xamarin/xamarin-macios/issues/3213 is fixed and conformance to 'AVQueuedSampleBufferRendering' is restored. | ||
[TV (11,0), Mac (10,13), iOS (11,0)] | ||
[Export ("timebase", ArgumentSemantic.Retain)] | ||
CMTimebase Timebase { get; } | ||
|
||
[iOS (8, 0), Mac (10,10)] | ||
[Field ("AVSampleBufferDisplayLayerFailedToDecodeNotification")] | ||
[Notification] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ namespace XamCore.CoreAudioKit { | |
#if XAMCORE_2_0 || !MONOMAC | ||
[iOS (9,0)][Mac (10,11, onlyOn64 : true)] | ||
[BaseType (typeof(AUViewControllerBase))] | ||
interface AUViewController : NSExtensionRequestHandling { | ||
interface AUViewController { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VincentDondain: This is a breaking change: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rolfbjarne It's Then based on https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/breaking-change-rules.md#types: Allowed
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also I asked about this exact case and you answered me :P https://xamarinhq.slack.com/archives/C03CCJNR7/p1515786537000437 Vincent:
Rolf:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @VincentDondain heh, ok, hopefully I'll remember the next time I run into this 😄 👍 |
||
[Export ("initWithNibName:bundle:")] | ||
[PostGet ("NibBundle")] | ||
IntPtr Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,21 @@ | |
// | ||
#define DOUBLE_BLOCKS | ||
using XamCore.ObjCRuntime; | ||
using XamCore.CloudKit; | ||
using XamCore.CoreData; | ||
using XamCore.CoreFoundation; | ||
using XamCore.Foundation; | ||
using XamCore.CoreGraphics; | ||
#if IOS | ||
using XamCore.QuickLook; | ||
#endif | ||
#if !TVOS | ||
using XamCore.Contacts; | ||
#endif | ||
#if !WATCH | ||
using XamCore.CoreAnimation; | ||
using XamCore.CoreMedia; | ||
using XamCore.CoreSpotlight; | ||
using XamCore.CloudKit; | ||
#endif | ||
using XamCore.SceneKit; | ||
using XamCore.Security; | ||
|
@@ -48,6 +56,7 @@ | |
|
||
#if MONOMAC | ||
using XamCore.AppKit; | ||
using XamCore.QuickLookUI; | ||
#else | ||
using XamCore.CoreLocation; | ||
using XamCore.UIKit; | ||
|
@@ -102,7 +111,7 @@ namespace XamCore.Foundation | |
interface NSArray<TValue> : NSArray {} | ||
|
||
[BaseType (typeof (NSObject))] | ||
interface NSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration { | ||
interface NSArray : NSSecureCoding, NSMutableCopying, INSFastEnumeration, CKRecordValue { | ||
[Export ("count")] | ||
nuint Count { get; } | ||
|
||
|
@@ -1372,7 +1381,7 @@ interface NSCompoundPredicate : NSCoding { | |
delegate void NSDataByteRangeEnumerator (IntPtr bytes, NSRange range, ref bool stop); | ||
|
||
[BaseType (typeof (NSObject))] | ||
interface NSData : NSSecureCoding, NSMutableCopying { | ||
interface NSData : NSSecureCoding, NSMutableCopying, CKRecordValue { | ||
[Export ("dataWithContentsOfURL:")] | ||
[Static] | ||
NSData FromUrl (NSUrl url); | ||
|
@@ -3495,7 +3504,7 @@ interface NSMutableData { | |
} | ||
|
||
[BaseType (typeof (NSObject))] | ||
interface NSDate : NSSecureCoding, NSCopying { | ||
interface NSDate : NSSecureCoding, NSCopying, CKRecordValue { | ||
[Export ("timeIntervalSinceReferenceDate")] | ||
double SecondsSinceReferenceDate { get; } | ||
|
||
|
@@ -3542,7 +3551,7 @@ interface NSDate : NSSecureCoding, NSCopying { | |
} | ||
|
||
[BaseType (typeof (NSObject))] | ||
interface NSDictionary : NSSecureCoding, NSMutableCopying { | ||
interface NSDictionary : NSSecureCoding, NSMutableCopying, NSFetchRequestResult, INSFastEnumeration { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we do not have correct support for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup I saw that: https://github.com/xamarin/xamarin-macios/blob/master/src/foundation.cs#L13034-L13043 But I already added it to the .ignore file: https://github.com/xamarin/xamarin-macios/pull/3187/files#diff-e909b6d483a4c2c9cbff0a2076e1406aR889 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure your first link is related - bad copy/paste ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, updated. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, please add |
||
[Export ("dictionaryWithContentsOfFile:")] | ||
[Static] | ||
NSDictionary FromFile (string path); | ||
|
@@ -4069,7 +4078,11 @@ partial interface NSExtensionItem : NSCopying, NSSecureCoding { | |
} | ||
|
||
[BaseType (typeof (NSObject))] | ||
interface NSNull : NSSecureCoding, NSCopying { | ||
interface NSNull : NSSecureCoding, NSCopying | ||
#if !WATCH | ||
, CAAction | ||
#endif | ||
{ | ||
[Export ("null"), Static] | ||
NSNull Null { get; } | ||
} | ||
|
@@ -5264,6 +5277,9 @@ partial interface NSUrl : NSSecureCoding, NSCopying | |
#endif | ||
#if !(MONOMAC && !XAMCORE_2_0) // exclude Classic/XM | ||
, NSItemProviderWriting, NSItemProviderReading | ||
#endif | ||
#if IOS || MONOMAC | ||
, QLPreviewItem | ||
#endif | ||
{ | ||
[Export ("initWithScheme:host:path:")] | ||
|
@@ -7726,7 +7742,7 @@ interface NSStreamDelegate { | |
} | ||
|
||
[BaseType (typeof (NSObject)), Bind ("NSString")] | ||
interface NSString2 : NSSecureCoding, NSMutableCopying | ||
interface NSString2 : NSSecureCoding, NSMutableCopying, CKRecordValue | ||
#if MONOMAC | ||
, NSPasteboardReading, NSPasteboardWriting // Documented that it implements NSPasteboard protocols even if header doesn't show it | ||
#endif | ||
|
@@ -10522,7 +10538,7 @@ interface NSValueTransformer { | |
[BaseType (typeof (NSValue))] | ||
// init returns NIL | ||
[DisableDefaultCtor] | ||
interface NSNumber { | ||
interface NSNumber : CKRecordValue, NSFetchRequestResult { | ||
[Export ("charValue")] | ||
sbyte SByteValue { get; } | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -696,7 +696,11 @@ interface GKLeaderboardViewController : UIAppearance | |
[Watch (3,0)] | ||
[Mac (10, 8)] | ||
[BaseType (typeof (GKPlayer))] | ||
interface GKLocalPlayer { | ||
interface GKLocalPlayer | ||
#if !WATCH | ||
: GKSavedGameListener | ||
#endif | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that's something that should be fixed |
||
{ | ||
[Export ("authenticated")] | ||
bool Authenticated { [Bind ("isAuthenticated")] get; } | ||
|
||
|
@@ -855,13 +859,14 @@ interface GKSavedGame : NSCopying { | |
} | ||
|
||
[NoWatch] | ||
[NoTV] | ||
[Protocol, Model] | ||
[BaseType (typeof (NSObject))] | ||
interface GKSavedGameListener { | ||
[NoTV] | ||
[Export ("player:didModifySavedGame:")] | ||
void DidModifySavedGame (GKPlayer player, GKSavedGame savedGame); | ||
|
||
[NoTV] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me go back one step (I might have induced you into an error earlier) This looks like the protocol does not really exists in tvOS and that Apple just annotated the members and not the type itself. In doubt let's open a radar and add a comment/link into the xtro data There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yea this is confusing. Also one comment in xtro said:
I was thinking they added the conformance (even if the protocol is empty on tvOS) for later. But yea I can also revert that, open a radar and annotate xtro. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's tricky since exposing the protocol (if not supported) could be considered a private API (when apps are analyzed) on tvOS. Since I don't see any benefit from an empty protocol then let's play it safe :) |
||
[Export ("player:hasConflictingSavedGames:")] | ||
void HasConflictingSavedGames (GKPlayer player, GKSavedGame [] savedGames); | ||
} | ||
|
@@ -2256,11 +2261,8 @@ interface GKTurnBasedExchangeReply | |
[Watch (3,0)] | ||
[Model, Protocol, BaseType (typeof (NSObject))] | ||
interface GKLocalPlayerListener : GKTurnBasedEventListener | ||
#if !TVOS && !WATCH | ||
, GKSavedGameListener | ||
#endif | ||
#if !WATCH | ||
, GKChallengeListener, GKInviteEventListener | ||
, GKChallengeListener, GKInviteEventListener, GKSavedGameListener | ||
#endif | ||
{ | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2426,7 +2426,11 @@ partial interface WebScriptObject { | |
"WeakUIDelegate", | ||
"WeakPolicyDelegate" } | ||
)] | ||
partial interface WebView { | ||
partial interface WebView | ||
#if MONOMAC | ||
: NSUserInterfaceValidations | ||
#endif | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: indent |
||
[Static] | ||
[Export ("canShowMIMEType:")] | ||
bool CanShowMimeType (string MimeType); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -539,7 +539,11 @@ interface WKUserScript : NSCopying { | |
#endif | ||
)] | ||
[DisableDefaultCtor ()] // Crashes during deallocation in Xcode 6 beta 2. radar 17377712. | ||
interface WKWebView { | ||
interface WKWebView | ||
#if MONOMAC | ||
: NSUserInterfaceValidations | ||
#endif | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: indent There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: indent |
||
|
||
[DesignatedInitializer] | ||
[Export ("initWithFrame:configuration:")] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,6 +175,19 @@ protected virtual bool Skip (Type type, string selectorName) | |
return !TestRuntime.CheckXcodeVersion (9, 0); | ||
} | ||
break; | ||
case "NSUrl": | ||
switch (selectorName) { | ||
case "previewItemTitle": | ||
// 'previewItemTitle' should be optional (fixed in XAMCORE_4_0) | ||
return true; | ||
} | ||
break; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: that block could have been inside a |
||
case "MKMapItem": // Selector not available on iOS 32-bit | ||
switch (selectorName) { | ||
case "encodeWithCoder:": | ||
return !TestRuntime.CheckXcodeVersion (9, 0); | ||
} | ||
break; | ||
#if !MONOMAC | ||
case "MTLCaptureManager": | ||
case "NEHotspotEapSettings": // Wireless Accessory Configuration is not supported in the simulator. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -681,6 +681,12 @@ protected override bool Skip (Type type, string protocolName) | |
|
||
case "UIPasteConfigurationSupporting": // types do not conform to protocol but protocol methods work on those types (base type tests in monotouch-test) | ||
return true; // Skip everything because 'UIResponder' implements 'UIPasteConfigurationSupporting' and that's 130+ types | ||
|
||
#if !__WATCHOS__ | ||
// Undocumented conformance (members were inlinded in 'UIViewController' before so all subtypes should conform) | ||
case "UIStateRestoring": | ||
return type.Name == "UIViewController" || type.IsSubclassOf (typeof (UIViewController)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
#endif | ||
} | ||
return base.Skip (type, protocolName); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's a conflict with the protocol name ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conflict it is (: