Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions tests/sharpie/Tests/Massagers/PlatformTypeMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@
@interface WebFetcher : NSObject <NSURLConnectionDelegate>
@property (nonatomic, readonly, copy) NSURL *url;
-(NSURLResponse *)getResponseForUrl:(NSURL *)url withCredential:(NSURLCredential *)credential;
-(void)loadDataWithUrl:(NSURL *)url completionHandler:(void (^)(NSData *, NSURLResponse *))handler;
@end
5 changes: 5 additions & 0 deletions tests/sharpie/Tests/Massagers/PlatformTypeMapping.iphoneos.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Foundation;
using ObjCRuntime;

Expand All @@ -11,4 +12,8 @@ interface WebFetcher : INSUrlConnectionDelegate {
// -(NSURLResponse *)getResponseForUrl:(NSURL *)url withCredential:(NSURLCredential *)credential;
[Export ("getResponseForUrl:withCredential:")]
NSUrlResponse GetResponseForUrl (NSUrl url, NSUrlCredential credential);

// -(void)loadDataWithUrl:(NSURL *)url completionHandler:(void (^)(NSData *, NSURLResponse *))handler;
[Export ("loadDataWithUrl:completionHandler:")]
void LoadDataWithUrl (NSUrl url, Action<NSData, NSUrlResponse> handler);
}
5 changes: 5 additions & 0 deletions tests/sharpie/Tests/Massagers/PlatformTypeMapping.macosx.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Foundation;
using ObjCRuntime;

Expand All @@ -11,4 +12,8 @@ interface WebFetcher : INSUrlConnectionDelegate {
// -(NSURLResponse *)getResponseForUrl:(NSURL *)url withCredential:(NSURLCredential *)credential;
[Export ("getResponseForUrl:withCredential:")]
NSUrlResponse GetResponseForUrl (NSUrl url, NSUrlCredential credential);

// -(void)loadDataWithUrl:(NSURL *)url completionHandler:(void (^)(NSData *, NSURLResponse *))handler;
[Export ("loadDataWithUrl:completionHandler:")]
void LoadDataWithUrl (NSUrl url, Action<NSData, NSUrlResponse> handler);
}
6 changes: 3 additions & 3 deletions tests/sharpie/Tests/ObjCGenerics.iphoneos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
interface CNLabeledValue : INSCopying, INSSecureCoding {
// @property (readonly, copy, nonatomic) ValueType ValueTypeProperty;
[Export ("ValueTypeProperty", ArgumentSemantic.Copy)]
NSObject<NSCopying, NSSecureCoding> ValueTypeProperty { get; }
NSObject<NSCopying, INSSecureCoding> ValueTypeProperty { get; }

// -(ValueType _Nullable)getValueTypeMethod;
[NullAllowed, Export ("getValueTypeMethod")]
[Verify (MethodToProperty)]
NSObject<NSCopying, NSSecureCoding> ValueTypeMethod { get; }
NSObject<NSCopying, INSSecureCoding> ValueTypeMethod { get; }

// -(void)setValueTypeMethod:(ValueType _Nullable)obj;
[Export ("setValueTypeMethod:")]
void SetValueTypeMethod ([NullAllowed] NSObject<NSCopying, NSSecureCoding> obj);
void SetValueTypeMethod ([NullAllowed] NSObject<NSCopying, INSSecureCoding> obj);
}
Comment on lines -9 to 19
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rolfbjarne This is interesting, so we have some inconsistencies in protocols?

Image

While INSSecureCoding is correct, why is NSCopying not getting picked to be INSCopying?


// @protocol A
Expand Down
6 changes: 3 additions & 3 deletions tests/sharpie/Tests/ObjCGenerics.macosx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
interface CNLabeledValue : INSCopying, INSSecureCoding {
// @property (readonly, copy, nonatomic) ValueType ValueTypeProperty;
[Export ("ValueTypeProperty", ArgumentSemantic.Copy)]
NSObject<NSCopying, NSSecureCoding> ValueTypeProperty { get; }
NSObject<NSCopying, INSSecureCoding> ValueTypeProperty { get; }

// -(ValueType _Nullable)getValueTypeMethod;
[NullAllowed, Export ("getValueTypeMethod")]
[Verify (MethodToProperty)]
NSObject<NSCopying, NSSecureCoding> ValueTypeMethod { get; }
NSObject<NSCopying, INSSecureCoding> ValueTypeMethod { get; }

// -(void)setValueTypeMethod:(ValueType _Nullable)obj;
[Export ("setValueTypeMethod:")]
void SetValueTypeMethod ([NullAllowed] NSObject<NSCopying, NSSecureCoding> obj);
void SetValueTypeMethod ([NullAllowed] NSObject<NSCopying, INSSecureCoding> obj);
}

// @protocol A
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,15 @@ public override void VisitTypeOfExpression (TypeOfExpression typeOfExpression)

public override void VisitMemberType (MemberType memberType)
{
// Visit children first so that type arguments (e.g. inside Action<NSData, NSURLResponse>)
// are mapped before the parent type is processed.
base.VisitMemberType (memberType);
VisitType (memberType, memberType.MemberName);
}

public override void VisitSimpleType (SimpleType simpleType)
{
base.VisitSimpleType (simpleType);
VisitType (simpleType, simpleType.Identifier);
}

Expand Down
Loading