diff --git a/tests/xtro-sharpie/DeprecatedCheck.cs b/tests/xtro-sharpie/DeprecatedCheck.cs index 0dbe76f52b..1202ddbb12 100644 --- a/tests/xtro-sharpie/DeprecatedCheck.cs +++ b/tests/xtro-sharpie/DeprecatedCheck.cs @@ -59,8 +59,9 @@ namespace Extrospection void ProcessObjcSelector (string fullname, VersionTuple objcVersion) { + var class_method = fullname [0] == '+'; var n = fullname.IndexOf ("::"); - string objcClassName = fullname.Substring (0, n); + string objcClassName = fullname.Substring (class_method ? 1: 0, n); string selector = fullname.Substring (n + 2); TypeDefinition managedType = ManagedTypes.FirstOrDefault (x => Helpers.GetName (x) == objcClassName); @@ -73,7 +74,7 @@ namespace Extrospection if (AttributeHelpers.HasAnyDeprecationForCurrentPlatform (managedType)) return; - var matchingMethod = managedType.Methods.FirstOrDefault (x => x.GetSelector () == selector && x.IsPublic); + var matchingMethod = managedType.Methods.FirstOrDefault (x => x.GetSelector () == selector && x.IsPublic && x.IsStatic == class_method); if (matchingMethod != null) ProcessItem (matchingMethod, fullname, objcVersion, framework); } @@ -152,8 +153,12 @@ namespace Extrospection public override void VisitObjCMethodDecl (ObjCMethodDecl decl, VisitKind visitKind) { - if (visitKind == VisitKind.Enter && AttributeHelpers.FindObjcDeprecated(decl.Attrs, out VersionTuple version)) - ObjCDeprecatedSelectors[decl.QualifiedName] = version; + if (visitKind == VisitKind.Enter && AttributeHelpers.FindObjcDeprecated (decl.Attrs, out VersionTuple version)) { + var qn = decl.QualifiedName; + if (decl.IsClassMethod) + qn = "+" + qn; + ObjCDeprecatedSelectors [qn] = version; + } } public override void VisitFunctionDecl (FunctionDecl decl, VisitKind visitKind) diff --git a/tests/xtro-sharpie/common-CoreBluetooth.ignore b/tests/xtro-sharpie/common-CoreBluetooth.ignore index de0181cb26..7970aa36a3 100644 --- a/tests/xtro-sharpie/common-CoreBluetooth.ignore +++ b/tests/xtro-sharpie/common-CoreBluetooth.ignore @@ -12,7 +12,6 @@ !missing-selector! CBCentralManager::init not bound ## short lived instance property being replaced with a static one -!deprecated-attribute-missing! CBManager::authorization missing a [Deprecated] attribute !missing-selector! CBManager::authorization not bound # Initial result from new rule missing-null-allowed diff --git a/tests/xtro-sharpie/common-CoreLocation.ignore b/tests/xtro-sharpie/common-CoreLocation.ignore index f837c64e18..49609f247f 100644 --- a/tests/xtro-sharpie/common-CoreLocation.ignore +++ b/tests/xtro-sharpie/common-CoreLocation.ignore @@ -1,11 +1,6 @@ # We have our own managed ctor !missing-pinvoke! CLLocationCoordinate2DMake is not bound -# xtro is confused because objc has two properties with the same name on objc, one static and the other one an instance one. -# we did add the deprecation in the correct one. Reported issue: https://github.com/xamarin/xamarin-macios/issues/9026 -!deprecated-attribute-missing! CLLocationManager::authorizationStatus missing a [Deprecated] attribute - - ## unsorted !missing-field! kCLHeadingFilterNone not bound