[ASC BUG] ASC strict mode error comparing (float + int) > float

VERIFIED FIXED in Q2 12 - Cyril

Status

Tamarin
Tools
P2
normal
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: Brent Baker, Unassigned)

Tracking

(Blocks: 1 bug)

unspecified
Q2 12 - Cyril
x86
Mac OS X
Bug Flags:
in-testsuite +
flashplayer-qrb +
flashplayer-bug -
flashplayer-triage +

Details

(Reporter)

Description

6 years ago
ASC should infer the "(v + 1)" to be a float value and therefore shouldn't have a problem with "float > float".

var v:float = 0;
var f:* =   (v + 1) > 0;
var g:* =   (v + 1) > v;


[Compiler] Error #1176: Comparison between a value with static type Number and a possibly unrelated type float.
   as3/Types/Float/test.as, Ln 12, Col 14: 
   var g:* =   (v + 1) > v;
   .............^
Flags: in-testsuite?
Flags: flashplayer-triage+
Flags: flashplayer-qrb+
Flags: flashplayer-bug-

Updated

6 years ago
Priority: -- → P2
Target Milestone: --- → Q2 12 - Cyril

Comment 1

6 years ago
Looks like evaluate(Context,BinaryExpressionNode) does not pass type information up the expression tree for non-constant expressions, and maybe not even then?  Looks pretty much broken...

Comment 2

6 years ago
The type information for the constant Number node is not updated with the information that it is float, when that is discovered.

Comment 3

6 years ago
Looks straightforward to fix for binary expressions but might also be broken for unary expressions; hard to know for sure but we fixed a bug around typeof for UnaryExpression that seemed similar.  (No test case was created.)  We need a number of test cases here to ferret out bugs.

Comment 4

6 years ago
changeset:   82:e28357651be7
user:        Lars T Hansen <lhansen@adobe.com>
date:        Thu Dec 08 09:41:32 2011 +0100
summary:     Fix 708300 - [ASC BUG] ASC strict mode error comparing (float + int) > float

Comment 5

6 years ago
Some test cases landed with that changeset.
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
(Reporter)

Comment 6

6 years ago
testmedia: test/acceptance/as3/asc/compare-with-inference.as

changeset:   7050:237162347a88
parent:      7048:2e3b3a868c0a
user:        Lars T Hansen <lhansen@adobe.com>
date:        Thu Dec 08 10:36:55 2011 +0100
summary:     Fix 708300 - [ASC BUG] ASC strict mode error comparing (float + int) > float, update asc.jar to asc-float 83:b67b2caffa58
Status: RESOLVED → VERIFIED
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.