[swift-evolution] Proposal: Introduce User-defined "Dynamic Member Lookup" Types

Slava Pestov spestov at apple.com
Fri Dec 1 00:26:42 CST 2017



> On Nov 30, 2017, at 10:23 PM, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> The difference between it and AnyObject lookup is that AnyObject lookup is:
> 
> b) type unsafe

Can you explain in what sense AnyObject lookup is type unsafe where your proposal is type safe? Both seem type safe in the sense that your program will not hit undefined behavior at runtime and instead trap if you access a non-existent member; both are type unsafe in the sense that you cannot reason statically about whether any specific member lookup will succeed. What is the distinguishing characteristic between the two that makes one safe and the other not?

Slava
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171130/4eb0a185/attachment.html>


More information about the swift-evolution mailing list