<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">I tried to better describe my alternative solution <a href="https://gist.github.com/Anton3/9931463695f1c3263333e18f04f9cd8e">here</a>.</p>
<blockquote style="margin:1.2em 0px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:0px 0px 1.2em!important">The problem with <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> is that it can only carry a metatype around and thats it. You may be able to extract it from there and than what? You’ll cast it the old fashion way.</p>
</blockquote>
<p style="margin:0px 0px 1.2em!important">Could you please explain, what <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> can’t do? If you only mean dispatching static members, then see below.</p>
<blockquote style="margin:1.2em 0px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:0px 0px 1.2em!important">As I may recall I asked the community in the following thread about <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Hashable</code> ability, which isn’t implementable without compiler magic and special internal protocols.</p>
</blockquote>
<p style="margin:0px 0px 1.2em!important">I suggest to move hashability of metatypes to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code>. <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code> can be <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Hashable</code> the same way as your <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Type<T></code>.</p>
<blockquote style="margin:1.2em 0px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:0px 0px 1.2em!important">Your last API for Type doesn’t solve any problems</p>
</blockquote>
<p style="margin:0px 0px 1.2em!important">I suggest to add <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">size</code> etc to <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code>. Static stuff will be handled by my version of <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Type<T></code> and dynamic stuff — by <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);border-radius:3px;display:inline;background-color:rgb(248,248,248)">Mirror</code>.</p>
<blockquote style="margin:1.2em 0px;border-left-width:4px;border-left-style:solid;border-left-color:rgb(221,221,221);padding:0px 1em;color:rgb(119,119,119);quotes:none">
<p style="margin:0px 0px 1.2em!important">You’re talking about the lack of the ability of dispatching static members (you also forget initializer)</p>
</blockquote>
<p style="margin:0px 0px 1.2em!important">Could you please cite, where I wrote about that? All 5 solutions I presented provide this feature using metatypes.</p>
<div title="MDH:PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPkkgdHJpZWQgdG8gYmV0dGVyIGRlc2NyaWJlIG15IGFs
dGVybmF0aXZlIHNvbHV0aW9uIFtoZXJlXShodHRwczovL2dpc3QuZ2l0aHViLmNvbS9BbnRvbjMv
OTkzMTQ2MzY5NWYxYzMyNjMzMzNlMThmMDRmOWNkOGUpLjwvZGl2PjxkaXYgY2xhc3M9ImdtYWls
X2V4dHJhIj48YnI+PC9kaXY+PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPiZndDsmbmJzcDtUaGUg
cHJvYmxlbSB3aXRoIGBNaXJyb3JgIGlzIHRoYXQgaXQgY2FuIG9ubHkgY2FycnkgYSBtZXRhdHlw
ZSBhcm91bmQgYW5kIHRoYXRzIGl0LiBZb3UgbWF5IGJlIGFibGUgdG8gZXh0cmFjdCBpdCBmcm9t
IHRoZXJlIGFuZCB0aGFuIHdoYXQ/IFlvdeKAmWxsIGNhc3QgaXQgdGhlIG9sZCBmYXNoaW9uIHdh
eS48YnI+PC9kaXY+PGRpdiBjbGFzcz0iZ21haWxfZXh0cmEiPjxicj48L2Rpdj48ZGl2IGNsYXNz
PSJnbWFpbF9leHRyYSI+Q291bGQgeW91IHBsZWFzZSBleHBsYWluLCB3aGF0IGBNaXJyb3JgIGNh
bid0IGRvPyBJZiB5b3Ugb25seSBtZWFuIGRpc3BhdGNoaW5nIHN0YXRpYyBtZW1iZXJzLCB0aGVu
IHNlZSBiZWxvdy48L2Rpdj48ZGl2IGNsYXNzPSJnbWFpbF9leHRyYSI+PGJyPjwvZGl2PjxkaXYg
Y2xh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