Bug 39343 - Embedded API: Method signature look up fails for generic types with more than one parameter
Summary: Embedded API: Method signature look up fails for generic types with more than...
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: 4.0.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-03 23:39 UTC by Jonathan Mitchell
Modified: 2016-03-04 15:15 UTC (History)
3 users (show)

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


Attachments

Description Jonathan Mitchell 2016-03-03 23:39:07 UTC
I want to call the following constructor via the embedded API:

public CloudClient(Func<string, string> filePathCallback)

The API reports that a method cannot be found for signature .ctor(System.Func`2<string, string>)
When I dump out the class method names I see .ctor(System.Func`2<string, string>) listed.

Discussed on the list here:
http://mono.1490590.n4.nabble.com/Re-Embedded-API-ctor-method-signature-query-mono-td4667551.html

Quoting the above:

It looks like a bug in mono_method_desc_new ():

https://github.com/mono/mono/blob/master/mono/metadata/debug-helpers.c#L378

The function is treating

	.ctor(System.Func`2<string, string>)

like a method with 2 arguments:

arg0 = System.Func`2<string
arg1 = string>

This is obviously wrong :)

The function is then storing the (wrong) argument count
for optimization purposes, and the comparison of methods
is starting to fail:

https://github.com/mono/mono/blob/master/mono/metadata/debug-helpers.c#L447
Comment 1 Jonathan Mitchell 2016-03-04 15:15:45 UTC
I put a pull request in on this here which seems to sort this on 4.0.0

https://github.com/mono/mono/pull/2724

4.2.0 will need this too

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