<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi everyone,<div class=""><br class=""></div><div class="">I am trying to understand existentials in Swift. I understand that in the</div><div class="">following code, P1 &amp; P2 is an existential type, because it supports values</div><div class="">from all types that conform to both P1 and P2.&nbsp;</div><div class=""><br class=""></div><div class="">protocol P1 {}</div><div class="">protocol P2 {}</div><div class="">var x: P1 &amp; P2</div><div class=""><br class=""></div><div class="">However, this raises a few questions for me:</div><div class=""><br class=""></div><div class=""><b class="">1. In the following code, is x also an existential?</b></div><div class="">protocol P {}</div><div class="">var x: P</div><div class=""><br class=""></div><div class="">The proposals / blog posts that I read always talk about the protocol composition syntax,</div><div class="">but to me, this is the same as the first example, just with only a single protocol requirement.</div><div class=""><br class=""></div><div class=""><b class="">2. Are Any and AnyObject also existentials?</b></div><div class="">So far, my understanding is:</div><div class="">Any is an existential with no requirements</div><div class="">AnyObject is an existential with only a class requirement</div><div class=""><b class=""><br class=""></b></div><div class=""><b class="">3. Why can I not extend Any / AnyObject?</b></div><div class="">For example, AnyObject is a protocol defined in the standard library. Why is it not extensible?</div><div class=""><b class=""><br class=""></b></div><div class="">Thanks and best regards,</div><div class="">Toni</div></body></html>