Bug 48146 - Operator (-) used in F# raises Specified method is not supported exception from C#.
Summary: Operator (-) used in F# raises Specified method is not supported exception fr...
Status: CONFIRMED
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-28 00:28 UTC by Mateusz Lewko
Modified: 2018-01-18 22:44 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Archive contains two projects ProjA (c#) and ProjB (f#) that show this bug. (20.54 KB, application/zip)
2016-11-28 00:28 UTC, Mateusz Lewko
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 48146 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
CONFIRMED

Description Mateusz Lewko 2016-11-28 00:28:23 UTC
Created attachment 18683 [details]
Archive contains two projects ProjA (c#) and ProjB (f#) that show this bug.

I have this generic function in F# thats uses (-) operator:

let inline sub a b = a - b


No I'm calling this function from C#:

int a = sub<int, int, int>(4, 1);

This raises an error:
Unhandled Exception:
System.NotSupportedException: Specified method is not supported.
  at ProjA.MainClass.Main (System.String[] args) [0x00000] in <4f209fa43741462db3b8f73ac83c35a2>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NotSupportedException: Specified method is not supported.
  at ProjA.MainClass.Main (System.String[] args) [0x00000] in <4f209fa43741462db3b8f73ac83c35a2>:0

Please not that this works fine for (+) operator or without inline keyword. 

I'm attaching simple projects with this code so you can see the bug by yourself.
Comment 1 Ludovic Henry 2018-01-18 22:44:44 UTC
I can reproduce with Mono 5.11.0.276 (master/117468d740a).

The steps are as follow:

 - msbuild ProjA
 - msbuild ProjB
 - cp ProjB/ProjB/obj/x86/Debug/ProjB.exe ProjA/ProjA/bin/Debug/
 - cp ProjB/ProjB/obj/x86/Debug/FSharp.Core.dll ProjA/ProjA/bin/Debug/
 - cd ProjA/ProjA/bin/Debug && mono ProjA.exe