<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 9, 2017, at 12:14 AM, Yvo van Beek via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Typealiases can greatly reduce the complexity of code. But I think one change in how the compiler handles them could make them even more powerful.</div></div></blockquote>[SNIP]<br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Perhaps it would be better if the extension would only apply to the parts of my code where I use the HeaderKey typealias and not to all Strings. This could be a great tool to specialize classes by creating a typealias and adding functionality to it. Another example I can think of is typealiases for dictionaries or arrays with added business logic through extensions (especially since you can't inherit from structs).<font color="#0b5394" face="monospace, monospace" class=""><br class=""></font></div><div class=""><br class=""></div><div class="">If you want to create an extension that adds functionality to all Strings you could have created an extension for String instead of HeaderKey.</div><div class=""><br class=""></div><div class="">Please let me know what you think. I'm not sure how complex this change would be.</div><div class="">I could write a proposal if you're interested.</div></div></div></blockquote><br class=""></div><div>Isn’t the point of “typealias" is that it does NOT have any change in semantics? The compiler doesn’t even have to acknowledge aliases in any run-time type tables, it just references the existing row of what the alias points to (based on a compile-time type table).</div><br class=""><div class="">As others suggested, this new semantic could be moved to a new type concept (with a new keyword).</div><div class=""><br class=""></div><div class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">—&nbsp;</div><div class="">Daryle Walker<br class="">Mac, Internet, and Video Game Junkie<br class="">darylew AT mac DOT com&nbsp;</div><div class=""><br class=""></div></div></div></div></body></html>