Bug 1372 - yield return && cannot convert `Mapper<T>' expression to type `Mapper<T>' (CS1503)
Summary: yield return && cannot convert `Mapper<T>' expression to type `Mapper<T>' (CS...
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 2.8
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2011-10-08 23:05 UTC by minco
Modified: 2011-10-13 04:08 UTC (History)
1 user (show)

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

demo solution (132.88 KB, application/x-zip-compressed)
2011-10-08 23:05 UTC, minco

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 minco 2011-10-08 23:05:56 UTC
Created attachment 647 [details]
demo solution

some code:

public static IEnumerable<T> Query<T>(this Database db, string commandText, params object[] args)
    var queryResults = db.Query(commandText, args==null||args.Length==0?null:args);
    if (queryResults != null)
        var mapper = Mapper<T>.Create();
        foreach (var record in queryResults)
            yield return mapper.Map(record);

    yield break;

will build failed
Comment 1 Mike Krüger 2011-10-10 07:07:30 UTC
@Marek: Seems to be a compiler issue.
Comment 2 Marek Safar 2011-10-10 13:39:00 UTC
Already fixed in mono master
Comment 3 minco 2011-10-13 04:08:12 UTC