Skip to content

Commit

Permalink
[CoreML] Fix feedback and xtro
Browse files Browse the repository at this point in the history
  • Loading branch information
dalexsoto committed Jun 30, 2017
1 parent 5cb5a0d commit 17334a7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/CoreML/MLDictionaryFeatureProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class MLDictionaryFeatureProvider {

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
public MLFeatureValue this [string featureName] {
get { return ObjectForKeyedSubscript (featureName); }
get { return GetFeatureValue (featureName); }
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/CoreML/MLMultiArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public partial class MLMultiArray {

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
public NSNumber this [nint idx] {
get { return ObjectAtIndexedSubscript (idx); }
get { return GetObjectAtIndexedSubscript (idx); }
set { SetObject (value, idx); }
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
public NSNumber this [NSNumber [] key] {
get { return ObjectForKeyedSubscript (key); }
get { return GetObjectForKeyedSubscript (key); }
set { SetObject (value, key); }
}
}
Expand Down
10 changes: 3 additions & 7 deletions src/coreml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ interface MLDictionaryFeatureProvider : MLFeatureProvider {

[Export ("initWithDictionary:error:")]
IntPtr Constructor (NSDictionary<NSString, NSObject> dictionary, out NSError error);

[Export ("objectForKeyedSubscript:")]
[return: NullAllowed]
MLFeatureValue ObjectForKeyedSubscript (string featureName);
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
Expand Down Expand Up @@ -157,7 +153,7 @@ interface MLFeatureValue : NSCopying {
MLFeatureValue FromDictionary (NSDictionary<NSObject, NSNumber> value, out NSError error);

[Export ("isEqualToFeatureValue:")]
bool IsEqualTo (MLFeatureValue value);
bool IsEqual (MLFeatureValue value);
}

[Watch (4,0), TV (11,0), Mac (10,13, onlyOn64: true), iOS (11,0)]
Expand Down Expand Up @@ -258,10 +254,10 @@ interface MLMultiArray {
// From MLMultiArray (NSNumberDataAccess) Category

[Export ("objectAtIndexedSubscript:")]
NSNumber ObjectAtIndexedSubscript (nint idx);
NSNumber GetObjectAtIndexedSubscript (nint idx);

[Export ("objectForKeyedSubscript:")]
NSNumber ObjectForKeyedSubscript (NSNumber [] key);
NSNumber GetObjectForKeyedSubscript (NSNumber [] key);

[Export ("setObject:atIndexedSubscript:")]
void SetObject (NSNumber obj, nint idx);
Expand Down
7 changes: 6 additions & 1 deletion tests/xtro-sharpie/common.pending
Original file line number Diff line number Diff line change
Expand Up @@ -648,4 +648,9 @@
!incorrect-protocol-member! MDLObjectContainerComponent::objectAtIndexedSubscript: is REQUIRED and should be abstract
!incorrect-protocol-member! MDLTransformComponent::keyTimes is REQUIRED and should be abstract
!incorrect-protocol-member! MDLTransformComponent::resetsTransform is REQUIRED and should be abstract
!incorrect-protocol-member! MDLTransformComponent::setResetsTransform: is REQUIRED and should be abstract
!incorrect-protocol-member! MDLTransformComponent::setResetsTransform: is REQUIRED and should be abstract

# CoreML
## we do not have NSFastEnumeration and decided to not bind objectForKeyedSubscript using a local method instead
!missing-protocol-conformance! MLDictionaryFeatureProvider should conform to NSFastEnumeration
!missing-selector! MLDictionaryFeatureProvider::objectForKeyedSubscript: not bound

0 comments on commit 17334a7

Please sign in to comment.