-
Notifications
You must be signed in to change notification settings - Fork 831
Closed
Labels
Area-Compiler-ImportAndInteropimport of .NET DLLs and interopimport of .NET DLLs and interopBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
Calling op_Addition on interface results in a Bad Image error.
Repro steps
-
open System.Numerics;; -
IAdditionOperators.op_Addition (3, 6) ;;
Expected behavior
Compiles with val it: int = 9
Actual behavior
Fails compilation with:
> IAdditionOperators.op_Addition (3, 6) ;;
System.BadImageFormatException: Bad IL format.
at <StartupCode$FSI_0012>.$FSI_0012.main@()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
Stopped due to error
Known workarounds
Don't call directly on the interface.
Related information
Other operations, like op_CheckedAddition work fine:
> IAdditionOperators.op_CheckedAddition (3, 6) ;;
val it: int = 9
Test on:
Microsoft (R) F# Interactive version 12.0.5.0 for F# 7.0
Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.4.0 Preview 2.1
Metadata
Metadata
Assignees
Labels
Area-Compiler-ImportAndInteropimport of .NET DLLs and interopimport of .NET DLLs and interopBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
Done