> On Nov 11, 2017, at 10:04 AM, Chris Lattner <sa...@nondot.org> wrote: > > > >>> On Nov 11, 2017, at 6:29 AM, Joe Groff via swift-evolution >>> <swift-evolution@swift.org> wrote: >>> >>> below the fold as far as the rest of the language is concerned. You could >>> just as well written what the importer synths up in Swift directly: >>> >>> func foo(bar: String) { >>> unsafeBitCast(objc_msgSend, to: @convention(c) (AnyObject, Selector, >>> NSString) -> ().self)(self, "fooWithBar:", NSString(bar)) >>> } >>> >>> and the rest of the language would be none the wiser. >> >> Though, since you bring up objc_msgSend, the way it works in ObjC might be a >> better fit for Swift's name lookup model, since their keyword argument >> models are similar. If Swift had a 'method of last resort' like ObjC's > > In fact, this is the subject of the next proposal that I will write up when I > have time.
It seems to me like a dynamic method-of-last-resort feature would subsume this proposal. Out of curiosity, why would we need both? -Joe
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution