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: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 4.8.0 (C9)
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-28 00:28 UTC by Mateusz Lewko
Modified: 2016-11-28 11:32 UTC (History)
2 users (show)

See Also:
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

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.

Note You need to log in before you can comment on or make changes to this bug.