<div dir="ltr">Hello Jens,<div><br></div><div>Thanks for an answer. Anyway it&#39;s confusing to have this &quot;as ___&quot; operator among <a href="https://developer.apple.com/library/prerelease/ios/documentation/Swift/Reference/Swift_StandardLibrary_Operators/index.html#//apple_ref/doc/uid/TP40016054">infix operators</a> and as <a href="https://developer.apple.com/library/mac/documentation/Swift/Conceptual/Swift_Programming_Language/Expressions.html#//apple_ref/swift/grammar/binary-expression">binary-expression</a>.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-12-04 20:30 GMT+01:00 Jens Alfke <span dir="ltr">&lt;<a href="mailto:jens@mooseyard.com" target="_blank">jens@mooseyard.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class=""><br><div><blockquote type="cite"><div>On Dec 4, 2015, at 3:21 AM, Elena Vilchik &lt;<a href="mailto:vilchik.elena@gmail.com" target="_blank">vilchik.elena@gmail.com</a>&gt; wrote:</div><br><div><span style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">I&#39;ve found<span> </span></span><a href="https://developer.apple.com/library/prerelease/ios/documentation/Swift/Reference/Swift_StandardLibrary_Operators/index.html#//apple_ref/doc/uid/TP40016054" style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">here</a><span style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important"><span> </span>that &quot;as&quot; operator has a lower precedence than &quot;*&quot; operator (132 vs 160).</span><br style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Why then this code compiles if multiplication should be made first? </span><br style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><font color="#3d85c6" style="font-family:Alegreya-Regular;font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">var x = 1<br>print(x as Int * 100)</font><br></div></blockquote><br></div></span><div>“as ___” is a *postfix* operator (the following type name has to be considered part of the ‘as’.) So there’s only one way to parse that expression as valid Swift, and thus the parser doesn’t even have to look at operator precedence.</div><div><br></div><div>In other words, `x as (Int * 100)` isn’t valid Swift syntax, so the parser doesn’t even consider it.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>—Jens</div></font></span></div></blockquote></div><br></div>