Bug 5979 - List support in generic method instantiation in binding got broken by JavaObjectExtensions.JavaCast()
Summary: List support in generic method instantiation in binding got broken by JavaObj...
Alias: None
Product: Android
Classification: Xamarin
Component: Tools and Addins ()
Version: 4.2.x
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2012-07-04 08:13 UTC by Atsushi Eno
Modified: 2012-07-24 08:07 UTC (History)
1 user (show)

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

repro project (162.25 KB, application/zip)
2012-07-04 08:13 UTC, Atsushi Eno

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Atsushi Eno 2012-07-04 08:13:19 UTC
Created attachment 2152 [details]
repro project

The latest binding generator fails to generate valid C# code for a method that contains a parameter of type List and resides in such a class that instantiates a parent generic class (e.g. FooAdapterView extends BaseAdapterView<BarAdapter>).

I'm attaching a failing project that exposes the issue.


	/svn/iPhoroidUI.Net/iPhoroidUI.Net/obj/Debug/generated/src/Org.Klab.Iphoroid.Widget.Listview.PullToRefreshEndlessListView.cs(359,90): error CS0311: The type `System.Collections.IList' cannot be used as type parameter `TResult' in the generic type or method `Java.Interop.JavaObjectExtensions.JavaCast<TResult>(this Android.Runtime.IJavaObject)'. There is no implicit reference conversion from `System.Collections.IList' to `Android.Runtime.IJavaObject'

etc... (ignore other errors, they either need metadata fixup or generator bugfix or generator generic enhancements)
Comment 4 Atsushi Eno 2012-07-24 08:07:56 UTC