<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I see model of <font face="monospace, monospace">Type&lt;T&gt;</font> as follows:</div><div><ol><li>Values of <font face="monospace, monospace">Type&lt;T&gt;</font> are identifiers of types (8 bytes, I guess)<br></li><li>All used identifiers are contained in <font face="monospace, monospace">Type&lt;Any&gt;</font><br></li><li><font face="monospace, monospace">Type&lt;T&gt;</font> contains a subset of those identifiers<br></li><li><font face="monospace, monospace">Type&lt;T&gt;</font> are usually created with default constructor <font face="monospace, monospace">Type&lt;T&gt;()</font><br></li><li>Upcasting uses constructor <font face="monospace, monospace">init&lt;U: T&gt;(upcasting: Type&lt;U&gt;)</font><br></li><li>Checking for conformance uses method <font face="monospace, monospace">isSubtype(of:)</font><br></li><li>Size of <font face="monospace, monospace">Type&lt;Type&lt;T&gt;&gt;</font> is 8, static size of <font face="monospace, monospace">Type&lt;SomeProtocol&gt;</font> is 0</li></ol></div></div><div class="gmail_quote">2016-07-13 18:25 GMT+03:00 Adrian Zubarev via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span>:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div>

<p>a = SomeClass.self<br></p><pre><code>expectTrue(a as? Any.Type == SomeClass.self)
expectTrue(a as? AnyClass == SomeClass.self)
expectTrue(a as? SomeClass.Type == SomeClass.self)</code></pre></div></div></blockquote><div>That example just demonstrates syntax of metatypes and does not count.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><ul>
<li><p>What about <code>dynamicType</code>?</p></li></ul></div></div></blockquote><div>It should have the following signature:</div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">func dynamicType&lt;T&gt;(_ var: T) -&gt; Type&lt;T&gt;</font></div><div><br></div><div>To return Type&lt;T&gt; means to return an identifier of U: T<br></div></div></div></div>