Roslyn: Name 'immutableArrays' is suggested for ImmutableArray<Frog> rather than 'frogs'

Created on 30 May 2020  路  2Comments  路  Source: dotnet/roslyn

Version Used: 16.6.0

using System.Collections.Immutable;

class Frog { }

class C
{
    void M()
    {
        var builder = ImmutableArray.CreateBuilder<Frog>();

        return new [||]C(builder.ToImmutable());
    }
}

馃洜 Generate constructor in 'C':

using System.Collections.Immutable;

class Frog { }

class C
{
    private ImmutableArray<Frog> immutableArrays;

    public C(ImmutableArray<Frog> immutableArrays)
    {
        this.immutableArrays = immutableArrays;
    }

    void M()
    {
        var builder = ImmutableArray.CreateBuilder<Frog>();

        return new C(builder.ToImmutable());
    }
}
Area-IDE Bug help wanted

Most helpful comment

toads or polywogs would also be acceptable names here.

All 2 comments

@allisonchou Want to takea look? We already have helpers that try to figure out names using Humanizer. Might be that this feature isn't properly going through that, or that we're not passing it the rigth data.

toads or polywogs would also be acceptable names here.

Was this page helpful?
0 / 5 - 0 ratings