dotnet/roslyn

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

Ouverte

#50 777 ouverte le 26 janv. 2021

 (1 commentaire) (0 réaction) (1 personne assignée)C# (4 257 forks)batch import
Area-IDEBugIDE-IntelliSenseIntelliSense-Completionhelp wanted

Métriques du dépôt

Stars
 (20 414 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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.

Guide contributeur