Yup, this declares ImportTool (a subclass of NSObject) with the lightweight 
generic parameters X, Y, and Z. Here 
<https://developer.apple.com/documentation/swift/imported_c_and_objective-c_apis/using_imported_lightweight_generics_in_swift>
 are some examples and how they map to Swift, which makes the exact declaration 
syntax a bit more clear.

Regards,
Saagar Jha

> On Mar 28, 2019, at 18:49, Andy Lee <[email protected]> wrote:
> 
> The compiler may accept it, but it doesn't interpret it the way you think.  
> You can confirm by checking whether your class formally conforms to the 
> protocols.  Try this with your old code and your new code, and compare:
> 
> NSLog(@"conforms to protocol? %d", [ImportTool 
> conformsToProtocol:@protocol(NSTableViewDataSource)]);
> 
> I think Quincey is right, what you really did is declare a generic type.  
> It's a subtle mistake.  Notice that this also compiles:
> 
> @interface  ImportTool <X, Y, Z> : NSObject
> @end
> 
> --Andy
> 
> On Mar 28, 2019, at 7:44 PM, Peter Hudson <[email protected] 
> <mailto:[email protected]>> wrote:
>> 
>> Very strange - the compiler is quite happy with my waywardness. 
>> Peter
>> 
>>> On 28 Mar 2019, at 23:39, Quincey Morris 
>>> <[email protected]> wrote:
>>> 
>>>> On Mar 28, 2019, at 15:58 , Peter Hudson <[email protected]> wrote:
>>>> 
>>>> @interface  ImportTool <NSTableViewDataSource, NSTableViewDelegate, 
>>>> NSEncoding> : NSObject
>>> 
>>> You’re Doing It Wrong™. You mean:
>>> 
>>>> @interface  ImportTool : NSObject <NSTableViewDataSource, 
>>>> NSTableViewDelegate, NSEncoding>
>>> 
>>> 
>>> I don’t know what it means the way you wrote it. Something about 
>>> lightweight generic syntax, perhaps?    
>> 
>> _______________________________________________
>> 
>> Cocoa-dev mailing list ([email protected])
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com 
>> <https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com>
>> 
>> This email sent to [email protected] <mailto:[email protected]>
> 
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected] 
> <mailto:[email protected]>)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com 
> <http://lists.apple.com/>
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com 
> <https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com>
> 
> This email sent to [email protected] <mailto:[email protected]>
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to