Area-IDEFeature - IDE0059help wanted
Repository-Metriken
- Stars
- (20.414 Sterne)
- PR-Merge-Metriken
- (Durchschn. Merge 6T 17h) (256 gemergte PRs in 30 T)
Beschreibung
Version Used: Visual Studio 2019 RC
Steps to Reproduce:
string Method(IDictionary<int, string> map, int key)
{
if (map.TryGetValue(key, out var text))
{
return map[key];
}
return null;
}
Apply the code fix for IDE0059 reported for the unused variable text.
Expected Behavior:
string Method(IDictionary<int, string> map)
{
if (map.TryGetValue(key, out var text))
{
return text;
}
return null;
}
Actual Behavior:
string Method(IDictionary<int, string> map)
{
if (map.TryGetValue(key, out _))
{
return map[key];
}
return null;
}