Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/introspection/ApiSignatureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,12 @@ protected virtual bool Check (char encodedType, Type type)
{
switch (encodedType) {
case '@':
// We use BindAsAttribute to wrap NSNumber/NSValue into more accurate Nullable<T> types
// So we check if T of nullable is supported by bindAs
var nullableType = Nullable.GetUnderlyingType (type);
if (nullableType != null)
return BindAsSupportedTypes.Contains (nullableType.Name);

return (type.IsInterface || // protocol
type.IsArray || // NSArray
(type.Name == "NSArray") || // NSArray
Expand Down Expand Up @@ -978,5 +984,14 @@ protected virtual bool IgnoreAsync (MethodInfo m)
}
return false;
}

// This must be kept in sync with generator.cs NSValueCreateMap and NSValueReturnMap
protected HashSet<string> BindAsSupportedTypes = new HashSet<string> {
"CGAffineTransform", "Range", "CGVector", "SCNMatrix4", "CLLocationCoordinate2D",
"SCNVector3", "Vector", "CGPoint", "CGRect", "CGSize", "UIEdgeInsets",
"UIOffset", "MKCoordinateSpan", "CMTimeRange", "CMTime", "CMTimeMapping",
"CATransform3D", "Boolean", "Byte", "Double", "Float", "Int16", "Int32",
"Int64", "SByte", "UInt16", "UInt32", "UInt64", "nfloat", "nint", "nuint",
};
}
}