Indexing on strings (e.g., myString[7]) duplicates the passed index expression, which results in incorrect code when the index expression has side effects, such as incrementing a value (myString[i++]).
Example, which would produce the string "01" instead of the expected "0":
https://typescripttolua.github.io/play/#code/FAGwpgLgBAllC8UAMBuUkoGcICcFQCIkBGAJgLWGxwG0YBqegXTSA
Indexing on strings (e.g.,
myString[7]) duplicates the passed index expression, which results in incorrect code when the index expression has side effects, such as incrementing a value (myString[i++]).Example, which would produce the string
"01"instead of the expected"0":https://typescripttolua.github.io/play/#code/FAGwpgLgBAllC8UAMBuUkoGcICcFQCIkBGAJgLWGxwG0YBqegXTSA