-
Notifications
You must be signed in to change notification settings - Fork 789
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
Bad image when calling op_Addition on interface #14012
Comments
Checked version is |
@vzarytovskii Curious, does C# allow this? I presume not? I assume we must be missing a check to disallow this? |
Nope, it doesn't for operators. It may for normal static methods with default implementation |
I'm getting the same exception running this in fsi
|
Just for historical reasons, this is why it's crashing (abstract vs virtual): Check will be introduced to ensure we generate call on virtual members, can't call abstracts. |
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:
Known workarounds
Don't call directly on the interface.
Related information
Other operations, like
op_CheckedAddition
work fine: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
The text was updated successfully, but these errors were encountered: