-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] KeyValuePair object in Array is handled as only key(?) #3771
Comments
I have investigated this and it's because in Fable we translate |
@dbrattli |
Description
When calling
Seq.toArray
on a genericDictionary
. The resulting values are typed asKeyValuePair
, but only contain the key. Accessing.Key
and.Value
properties is transpiled as.[0]
and.[1]
, therefore returning the first and second element of the key value, instead of returning key and value. In the case of a string key, these are the first and second char:Repro code
test.fsx
test.cmd
dotnet fable . --lang python python test.py
Expected and actual results
For the array case, expecting the same result as for the list case.
Related information
dotnet fable --version
: 4.13.0dotnet tool list/update/install
: 4.13.0We got a performant workaround skipping the
toArray
step and instead initiating an Array usingArray.zeroCreate
.@Freymaurer
The text was updated successfully, but these errors were encountered: