joshtynjala commented on issue #78: Assign to Boolean variable does not convert 
to true or false, breaking loose comparison with ==
URL: https://github.com/apache/royale-compiler/issues/78#issuecomment-461601579
 
 
   It's also worth mentioning that this change will ensure that existing AS3 
code continues to work properly when brought into Royale, which (as you 
frequently mention, Alex) is one of our goals. It would not be "just in case", 
but actually conforming to developer expectations of how the language has 
always worked.
   
   Additionally, we already have int, uint, Number, and String being coerced on 
assignment because it's been found to be necessary for various reasons. It 
would actually be counter-intuitive if Boolean weren't given the same treatment.
   
   This also gives ActionScript an advantage over TypeScript. This automatic 
coercion on assignment makes it harder in ActionScript for a variable to hold 
the wrong type, which makes things more predictable for developers. It's still 
possible to write code that will do it, of course, but it's hard enough that 
someone would have to do it with intent.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to