I had to do some index calculation and was catched by the folllowing:
The following source:
def cvt(str: String) -> uint16[] {
let size = str.size;
var utf = uint16[](size);
utf[size-1] = 0;
return utf;
}
results in the error message:
BugTest3.tart:5: error: Type mismatch converting infixSubtract(size, 1) from
'{Result:iint8|int16|int32|int64|uint8|uint16|uint32|uint64|float|double|#consta
nt_int}' to 'int64'
If I introduce a new let value:
def cvt(str: String) -> uint16[] {
let size = str.size;
var utf = uint16[](size);
let tmp = size-1;
utf[tmp] = 0;
return utf;
}
then the error is gone. Again, I think that both variants should be
semantically identical.
BTW: Do you prefer such small code sequences or real test cases constructed
from Test class?
Original issue reported on code.google.com by kai.na...@gmail.com on 9 Dec 2010 at 5:08
Original issue reported on code.google.com by
kai.na...@gmail.com
on 9 Dec 2010 at 5:08