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
This was originally discovered on the F# Forums in a larger code sample.
❌ Defining 2 types and putting them both inside Result.Ok and sending all the code to FSI at once results in an error:
Microsoft (R) F# Interactive version 12.0.1.0 for F# 6.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
> type A = A
- type B = B
- let x : Result<_, unit> = Ok (A, B);;
error FS0193: internal error: Could not load type 'B' from assembly 'FSI-ASSEMBLY, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Code:
type A = A
type B = B
let x : Result<_, unit> = Ok (A, B);;
❌ Putting the values into the Error case fails with the same error:
typeA= A
typeB= B
letx:Result<unit,_>= Error (A, B);;
❌ Using an anonymous record instead of a tuple inside the result give the same error:
typeA= A
typeB= B
letx:Result<_,unit>= Ok {| A = A; B = B |}
✔ Using a Choice1of2 instead of Result works fine:
typeA= A
typeB= B
letx:Choice<_,unit>= Choice1Of2 (A, B)
✔ If you send the first two lines to FSI in one step, and then send the last line to FSI as a second step, there is no error.
Expected behavior
All of the above code samples should compile and run without error.
Known workarounds
Sending the code to FSI in smaller, separate chunks.
Related information
Provide any related information (optional):
Windows 10
F# Interactive version 12.0.1.0 for F# 6.0
Tested in VS 2022 and VS Code
The text was updated successfully, but these errors were encountered:
This was originally discovered on the F# Forums in a larger code sample.
❌ Defining 2 types and putting them both inside
Result.Ok
and sending all the code to FSI at once results in an error:Code:
❌ Putting the values into the Error case fails with the same error:
❌ Using an anonymous record instead of a tuple inside the result give the same error:
✔ Using a Choice1of2 instead of Result works fine:
✔ If you send the first two lines to FSI in one step, and then send the last line to FSI as a second step, there is no error.
Expected behavior
All of the above code samples should compile and run without error.
Known workarounds
Sending the code to FSI in smaller, separate chunks.
Related information
Provide any related information (optional):
The text was updated successfully, but these errors were encountered: