<HTML><BODY><p>Hello.<br>I stumbled on ambiguous behaviour of compiler. Is not allowed explicitly indicate type in Generic typealias.</p><br><br><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">struct</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> Сarriage<T> {</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">let</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> g = [</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">T</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">]()</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">}</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"> </p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">struct</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> Coma<T> {</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">typealias</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> R = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">Сarriage</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"><</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">T</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">></span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">let</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> m = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">R</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">()</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">let</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> d = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">R</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"><</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #703daa;">String</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">>() \\ </span><strong>error: cannot specialize non-generic type 'Сarriage<T>'</strong></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"></span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">var</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> b = </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">Сarriage</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"><</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #703daa;">String</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">>()</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">mutating</span><span style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #ba2da2;">func</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> work() {</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">m</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">.g.append(<#T##newElement: T##T#>) \\ what I can write here?</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">b</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #4f8187;">g</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3e1e81;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #3e1e81;">append</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b;" data-mce-style="font-variant-ligatures: no-common-ligatures; color: #d12f1b;">"Z"</span><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">)</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;"> }</span></p><p style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" data-mce-style="margin-bottom: 0px; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures;" data-mce-style="font-variant-ligatures: no-common-ligatures;">}</span></p><br><br>-- <br>Седых Александр</BODY></HTML>