[All] Fix StringBuilder.Chars getter and setter#4339
Conversation
Python Type Checking Results (Pyright)
Excluded files with errors (3 files)These files have known type errors and are excluded from CI. Remove from
|
|
We also need to update |
Indeed, I though I tested it locally but I think I didn't save the tests files at that moment 🤦
Python.Library seems to be referencing the I am looking into it |
|
Strangely Python test is failing on CI but working for me locally 😅 But like you said @dbrattli, it seems to be using the previous version of the code 🤔 The test should be def StringBuilder__get_Chars_Z524259A4(x: StringBuilder, index: int32) -> str:
len_1: int32 = int32.ZERO
i: int32 = int32.ZERO
while ((len_1 + len(x.buf[i])) <= index) if (i < len(x.buf)) else False:
len_1 = len_1 + len(x.buf[i])
i = i + int32.ONE
if True if (index < int32.ZERO) else (i >= len(x.buf)):
raise Exception("Index was outside the bounds of the array")
else:
pos: int32 = index - len_1
return x.buf[i][pos]but it is using: def StringBuilder__get_Chars_Z524259A4(x: StringBuilder, index: int32) -> str:
len_1: int32 = int32.ZERO
i: int32 = int32.NEG_ONE
while (len_1 < index) if ((i + int32.ONE) < int32(len(x.buf))) else False:
i = i + int32.ONE
len_1 = len_1 + get_length(x.buf[i])
if True if (True if (index < int32.ZERO) else (i < int32.ZERO)) else (i >= int32(len(x.buf))):
> raise Exception("Index was outside the bounds of the array")
E Exception: Index was outside the bounds of the arrayAny idea why ? |
|
@MangelMaxime This branch seems quite old which could be an issue. Perhaps try to rebase on main to get it up-to-date to see if that has something to do with the old code being used? |
85bf439 to
10f1453
Compare
Right, I changed my git config which broke Let's try again with the latest version of |
|
Ok, that explains it now. So Python already had a separate |
|
Thank you for looking into it and indeed I missed the Python specific files. |
Fix #4338