Skip to content

RCS1250 Does not offer 'Simplify Object Creation' for IAsyncEnumerable<> #1766

Description

@John-Leitch

RCS1250 is not offered in the following case:

namespace Foo;

internal class Program
{
    private static string[] _test = ["foo", "bar"];

    private record TestRecord(string Test);

    private static async System.Collections.Generic.IAsyncEnumerable<TestRecord> TestAsync()
    {
        foreach (var test in _test)
        {
            yield return new [|TestRecord|](test);
        }
    }

    private static void Main(string[] args)
    {
        Console.WriteLine("Hello, World!");
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions