<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I do not think that I was conflating these two aspects. Using #type(self) would return the particular type of the current instance (dynamic type) while using #type(A.var) would return the declared (static) type of the property. Now, <div class=""><br class=""></div><div class=""> let a = A()</div><div class=""> #type(a.var) </div><div class=""><br class=""></div><div class="">would again return the actual (dynamic) type of var</div><div class=""><br class=""></div><div class="">In essence, I don’t see why we need to separate the mechanisms for querying these types when the distinction can be made on the grounds whether we are querying the type of a particular value/instance or a particular (not instantiated) declaration. </div><div class=""><br class=""></div><div class="">— Taras</div><div class=""><br class=""></div><div class="">P.S. Does Swift today even have the means of querying the static type of a variable once it has been instantiated, i.e. can I programmatically find out that x has been declared as P in this scope:</div><div class=""><br class=""></div><div class="">let x : P = TypeThatConformsToP()</div><div class=""><br class=""></div><div class="">If you really want to differentiate between these two then we’d need two separate mechanisms, e.g. #statictype(), #dynamictype(), with #dynamictype() referring to the instantiated value and $statictype() referring to the variable declaration.</div><div class=""><br class=""></div><div class=""><br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 14 Apr 2016, at 22:59, Joe Groff <<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class="Apple-interchange-newline">On Apr 14, 2016, at 1:11 PM, Taras Zakharko <<a href="mailto:taras.zakharko@uzh.ch" class="">taras.zakharko@uzh.ch</a>> wrote:<br class=""><br class="">I do not understand why we can’t do<br class=""><br class="">type(self)<br class=""><br class="">or even<br class=""><br class="">#type(self)<br class=""><br class="">Personally, I find .Self business to be quite confusing and idiosyncratic. Having a generic #type() directive would be a general improvement for the language design and it would also open up future possibilities such as<br class=""><br class="">extension A where A.B == #type(A.C.property1) {<br class=""><br class="">}<br class=""><br class="">and other potentially useful things.<span class="Apple-converted-space"> </span><br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Swift's type system has static and dynamic manifestations, and you're conflating them here. #type in a situation like `where A.B == #type(A.C.property1)` would have to produce the static type of property, whereas `x.dynamicType` today produces the dynamic type of a class or existential.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">-Joe</span></div></blockquote></div><br class=""></div></div></body></html>