<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 5, 2017, at 1:13 PM, Thorsten Seitz via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: SourceCodePro-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><font face="Menlo" class="">let result = <b class="">dynamic</b> x.foo.bar // will crash if foo or bar are not present</font></div><div class="" style="font-family: SourceCodePro-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">let result = <b class="">dynamic?</b> x.foo.bar // will return nil if foo or bar are not present</font></div></div><div style="font-family: SourceCodePro-Regular; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><span class="" style="font-family: Menlo;">// will crash if foo or bar are not present</span></div><div class=""><font face="Menlo" class="">let result = <b class="">dynamic</b> {</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>let y = x.foo.bar</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>let z = y.baz(42)</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>return z.zork()</font></div><div class=""><font face="Menlo" class="">}</font></div><div class=""><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><span class="" style="font-family: Menlo;">// will return nil if foo or bar are not present</span></div><div class=""><font face="Menlo" class="">let result = <b class="">dynamic?</b> {</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>let y = x.foo.bar</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>let z = y.baz(42)</font></div><div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>return z.zork()</font></div><div class=""><font face="Menlo" class="">} </font></div></div></div></div></blockquote></div><br class=""><div class="">As other people have pointed out, the behavior of something conforming to these protocols in no way implies that they crash if lookup fails. That is up to the implementer, and I assume most, if not all, will choose sane defaults (optional/throws) rather than just crashing.</div><div class=""><br class=""></div><div class="">But I think the main thing missing from this is where `x` came from. As I think Chris pointed out before, these values have to come from somewhere. If you have no idea what the type of the variable you're dealing with is and what its intended behavior might be, then I don't understand how you could even write this code in the first place.</div></body></html>