Closed vf42 closed 6 months ago
Consider a sample F# function:
let test1 (s: string) : bool = if s.Length < 3 then false else s[3] = 'A'
When compiled to Python with Fable, I get the following output:
def test1(s: str) -> bool: if len(s) < 3: return False else: return s[3] == "A"
Which results in incorrect behavior since in python list and string indices are zero-based.
Expected behavior: index access on the last line to be updated as s[2]
s[2]
$ dotnet fable --version 4.16.0
Realized this belongs in https://github.com/fable-compiler/Fable/issues
Consider a sample F# function:
When compiled to Python with Fable, I get the following output:
Which results in incorrect behavior since in python list and string indices are zero-based.
Expected behavior: index access on the last line to be updated as
s[2]