{"action":"created","issue":{"url":"https://api.github.com/repos/Quick/Quick/issues/372","labels_url":"https://api.github.com/repos/Quick/Quick/issues/372/labels{/name}","comments_url":"https://api.github.com/repos/Quick/Quick/issues/372/comments","events_url":"https://api.github.com/repos/Quick/Quick/issues/372/events","html_url":"https://github.com/Quick/Quick/issues/372","id":103997864,"number":372,"title":"Generic ObjC subclasses","user":{"login":"jedlewison","id":2030036,"avatar_url":"https://avatars.githubusercontent.com/u/2030036?v=3","gravatar_id":"","url":"https://api.github.com/users/jedlewison","html_url":"https://github.com/jedlewison","followers_url":"https://api.github.com/users/jedlewison/followers","following_url":"https://api.github.com/users/jedlewison/following{/other_user}","gists_url":"https://api.github.com/users/jedlewison/gists{/gist_id}","starred_url":"https://api.github.com/users/jedlewison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedlewison/subscriptions","organizations_url":"https://api.github.com/users/jedlewison/orgs","repos_url":"https://api.github.com/users/jedlewison/repos","events_url":"https://api.github.com/users/jedlewison/events{/privacy}","received_events_url":"https://api.github.com/users/jedlewison/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Quick/Quick/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-31T06:50:38Z","updated_at":"2015-09-01T03:04:23Z","closed_at":null,"body":"I'm having in issue that I think, but am not sure, may be related to generic objc subclasses.\r\n\r\nWhen using Quick/Nimble to test a generic objc class, I *always* get a crash after the first example runs. Making the class be non-generic fixes the crash. I'm able to test the class using a plain old XCTestCase subclass, but then of course I want to gouge my eyes out because Quick and Nimble make tests so much easier to read and maintain.\r\n\r\nAnyway, the call stack leads up to this:\r\n\r\n```\r\n+ (SEL)addInstanceMethodForExample:(Example *)example {\r\n    IMP implementation = imp_implementationWithBlock(^(QuickSpec *self){\r\n        currentSpec = self;\r\n        [example run]; // <-- crash\r\n    });\r\n```\r\n\r\nI haven't looked too deeply into this, wanted to flag in case there are any known workarounds, or if it's unlikely that my supposition is correct about the issue being use of a generic objective c subclass.\r\n\r\n(It's a subclass of NSOperation, so making it a swift-only class or a struct is not an option.)"},"comment":{"url":"https://api.github.com/repos/Quick/Quick/issues/comments/136560839","html_url":"https://github.com/Quick/Quick/issues/372#issuecomment-136560839","issue_url":"https://api.github.com/repos/Quick/Quick/issues/372","id":136560839,"user":{"login":"jedlewison","id":2030036,"avatar_url":"https://avatars.githubusercontent.com/u/2030036?v=3","gravatar_id":"","url":"https://api.github.com/users/jedlewison","html_url":"https://github.com/jedlewison","followers_url":"https://api.github.com/users/jedlewison/followers","following_url":"https://api.github.com/users/jedlewison/following{/other_user}","gists_url":"https://api.github.com/users/jedlewison/gists{/gist_id}","starred_url":"https://api.github.com/users/jedlewison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jedlewison/subscriptions","organizations_url":"https://api.github.com/users/jedlewison/orgs","repos_url":"https://api.github.com/users/jedlewison/repos","events_url":"https://api.github.com/users/jedlewison/events{/privacy}","received_events_url":"https://api.github.com/users/jedlewison/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T03:04:23Z","updated_at":"2015-09-01T03:04:23Z","body":"Hey @jeffh, I'm going to close this. I think it was a combination of user error and the compiler letting me get away without providing enough type information—basically I was testing a subclass of the generic subclass, and didn't adorn the second subclass with type information. Even if I shouldn't have to do that, doing it makes the crash go away. I'm still not entirely sure exactly what was going on, but since generic subclasses of NSObjects definitely do work with Quick and Nimble, I'll close the ticket. I'll follow up if there's anything more useful."}}