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 <ag...@mac.com> 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 <peter.hud...@me.com > <mailto:peter.hud...@me.com>> wrote: >> >> Very strange - the compiler is quite happy with my waywardness. >> Peter >> >>> On 28 Mar 2019, at 23:39, Quincey Morris >>> <quinceymor...@rivergatesoftware.com> wrote: >>> >>>> On Mar 28, 2019, at 15:58 , Peter Hudson <peter.hud...@me.com> 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 (Cocoa-dev@lists.apple.com) >> >> 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 ag...@mac.com <mailto:ag...@mac.com> > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com > <mailto:Cocoa-dev@lists.apple.com>) > > 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 saa...@saagarjha.com <mailto:saa...@saagarjha.com> _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com