History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-15587
Type: Bug Bug
Status: Community Community
Priority: None None
Assignee: Kristen Sindac
Reporter: Henry Minsky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Flex SDK

Compiler does not coerce boolean to numbers according to ECMAscript spec

Created: 05/16/08 04:57 PM   Updated: 05/16/08 04:57 PM
Component/s: Compiler API
Security Level: Public (All JIRA Users )

Severity: Incorrectly Functioning with Workaround
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex 3 (Released)
Affected OS(s): Windows - XP
Steps to Reproduce:
Steps to reproduce:
1. Compile code with this expression

return 0 + (al > bl) - (al < bl)|
   

2.
3.
 
 Actual Results:
  |line unknown: Error: Implizite Umwandlung eines Werts des Typs Boolean in einen nicht verwandten Typ Number, in line: return 0 + (al > bl) - (al < bl)|

Implicit cast of a value from type Boolean to a not related type Number, [...].

 
 Expected Results:
 
 
booleans should be coerced to zero or one in a Numeric context by the compiler.
 Workaround (if any):
 
 
 return ((al > bl)?1:0) - ((al < bl)?1:0);

Language Found: English
Bugbase Id: none
QA Owner: Kristen Sindac
Participants: Henry Minsky and Kristen Sindac
Browser: Firefox 2.x
JDK: Sun 1.5.x


 All   Comments      Sort Order:
There are no comments yet on this issue.