on Mon Feb 06 2017, Andrew Trick <swift-users-AT-swift.org> wrote: >> On Feb 6, 2017, at 8:51 PM, Dave Abrahams <dabrah...@apple.com> wrote: >> >> >> on Mon Feb 06 2017, Andrew Trick <atrick-AT-apple.com> wrote: >> > >>> Is a missing declaration a use case that needs to be supported? >> >> I couldn't say. >> >>> Wouldn’t it be more proper to use selector based dispatch in those >>> cases? >> >> Example, please? I don't know what that means, though I probably should. >> >> -- >> -Dave > > I phrased that as a question because I'm the last person who should be > giving advice here... What I had in mind is this: > > if ([self isKindOfClass:NSClassFromString(@“Bar”)]) { > self.perform(@selector(FakeBarProtocol.foo)) > } > > It's not type safe, but it's a lot better than outright lying about > the reference's dynamic type.
Presumably there's a way to express that in Swift, but if it uses varargs I expect it's pretty darned inefficient. -- -Dave _______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users