-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
Area-IDEBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Milestone
Description
Version Used:
Steps to Reproduce:
namespace MyNamespace;
record struct ID<T>(T Key);
class C
{
void M(int id)
{
N(id, new Dictionary<ID<int>, string>());
// The generic type is required for the repro
// The inner function is required for the repro
// The record struct is required for the repro
void N<T>(T id, Dictionary<ID<T>, string> d)
{
if (d.TryGetValue(new(id), out string? s))
// ^^^^^^^ Introduce local for this range
{
}
}
}
}Expected Behavior:
void N<T>(T id, Dictionary<ID<T>, string> dic)
{
ID<T> key = new(id);
if (dic.TryGetValue(key, out string? s))
{
}
}Actual Behavior:
void N<T>(T id, Dictionary<ID<T>, string> dic)
{
global::MyNamespace.ID<T> key = new(id);
// ^^^^^^^^^^^^^^^^^^^ Redundant qualifier
if (dic.TryGetValue(key, out string? s))
{
}
}Metadata
Metadata
Assignees
Labels
Area-IDEBughelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on itThe issue is "up for grabs" - add a comment if you are interested in working on it
Type
Projects
Status
Completed