dart-archive / ts2dart

ts2dart TypeScript to Dart transpiler
Apache License 2.0
181 stars 62 forks source link

Unnecessary cast #362

Closed mhevery closed 8 years ago

mhevery commented 8 years ago

Given:

0x22 | 0xF0

Expected:

0x22 | 0xF0

Actual:

(0x22 as int) | (0xF0 as int)

The reason we add casting is because it is required in this case

var a = 0x22;
var b = 0xF0;
a | b

because Typescript makes a and b a number, which does need to be down casted to an int.

mprobst commented 8 years ago

Fixed.