You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some array expressions fail to compile with the following error message: Error in pass3 for type Program, error: ldelem. This is easily reproduced with the latest F# 9 (.NET 9) on Windows.
Repro steps
letarr1=[|0;1;2;3|]letarr2=[|0UL;1UL;2UL;3UL |]letwrap x =[| x |]letgood=[|for a in arr1 do wrap a |]letbad=[|for a in arr2 do wrap a |]// this is causing the prob
When copy-paste the above code to dotnet fsi, the last line produces the error:
> let bad = [| for a in arr2 do wrap a |];;
error FS0192: internal error: Error in pass3 for type <StartupCode$FSI_0003>.$FSI_0003, error: ldelem
Expected behavior
It should compile.
Actual behavior
Internal error
Known workarounds
By using F# 8 (.NET 8) the same code compiles:
>letarr1=[|0;1;2;3|]-letarr2=[|0UL;1UL;2UL;3UL |]-letwrap x =[| x |]-letgood=[|for a in arr1 do wrap a |]-letbad=[|for a in arr2 do wrap a |];;valarr1:int array =[|0;1;2;3|]valarr2:uint64 array =[|0UL;1UL;2UL;3UL|]valwrap:x:'a ->'a arrayvalgood:int array array =[|[|0|];[|1|];[|2|];[|3|]|]valbad:uint64 array array =[|[|0UL|];[|1UL|];[|2UL|];[|3UL|]|]
Related information
I'm using the latest .NET 9 (VS 17.12.3) on Windows.
Some array expressions fail to compile with the following error message:
Error in pass3 for type Program, error: ldelem
. This is easily reproduced with the latest F# 9 (.NET 9) on Windows.Repro steps
When copy-paste the above code to
dotnet fsi
, the last line produces the error:Expected behavior
It should compile.
Actual behavior
Internal error
Known workarounds
By using F# 8 (.NET 8) the same code compiles:
Related information
I'm using the latest .NET 9 (VS 17.12.3) on Windows.
The text was updated successfully, but these errors were encountered: