Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
Created attachment 18459 [details]
Solution for testing
Can not change binding type form ArrayList to Object
Build the attached ArrayList.sln. You will receive errors dealing with converting ArrayList and Object.
This is a simplified version of a case where we find a base class returns Object yes the derived class returns an ArrayList. We need to change the return type to an Object to satisfy the abstract base class.
This is a blend of limitations, misunderstanding of the binding generator tool, and wrong API design decision.
You can't automatically generate such a code.
Binding generator is not has no human beings behind and cannot automatically guess that the object of what you manually described as "managedReturn" type actually needs casts to the destination target type. You may specify WhateverNamespace.FooBarBaz, instead of Java.Lang.Object, and there is no automatic way to convert to IList<T>, so there are cases that you simply cannot do that.
This could have been avoided if we didn't design the API to generate IList<T> instead of Java.Util collections. But that cannot be changed anymore.
Marking this bug as RESOLVED ANSWERED due to the comment in https://bugzilla.xamarin.com/show_bug.cgi?id=46949#c3 and the limitations present. If this is still a bug and can be addressed, please feel free to re-open this bug.