dotnet/roslyn

Completion shows other properties in generic method inside object initializers, not types

オープン

#50,777 opened on 2021/01/26

 (1 件のコメント) (0 件のリアクション) (1 人の担当者)C# (4,257 件のフォーク)batch import
Area-IDEBugIDE-IntelliSenseIntelliSense-Completionhelp wanted

Repository metrics

Stars
 (20,414 個のスター)
PR merge metrics
 (平均マージ 6d 17h) (30d で 256 merged PRs)

説明

A bit complicated, but a repro speaks many, many words:

namespace Test
{
    public class Class1
    {
        public string Prop { get; set; }
        public string Prop2 { get; set; }

        public string M<T1, T2>()
        {
            _ = new Class1
            {
                Prop = M<string, $$
            }
        }
    }
}

Invoking completion at the $$ shows Prop2, not types. If I add another >, or fill in a value for Prop2 above/below, I correctly get type completion there.

コントリビューターガイド