-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Feature
Copy link
Labels
Area-IDEhelp 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: Visual Studio 17.13.0 Preview 2.1
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
class C<TKey, TItem> // : IReadOnlyDictionary<TKey, TItem>
{
public C(ImmutableArray<TItem> items, ImmutableArray<TKey> keys)
{
}
// Originally added via "Implement IReadOnlyDictionary<TKey, Item>"
public IEnumerable<TKey> Keys => throw new NotImplementedException();
}On the constructor parameter for keys, there is no "Create and assign field 'keys'" like there is for items. Instead, only "Initialize property 'Keys'":
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
class C<TKey, TItem> // : IReadOnlyDictionary<TKey, TItem>
{
public C(ImmutableArray<TItem> items, ImmutableArray<TKey> keys)
{
Keys = keys;
}
// Originally added via "Implement IReadOnlyDictionary<TKey, Item>"
public IEnumerable<TKey> Keys { get; }
}This is not desirable because the public Keys member is intended to remain IEnumerable<TKey> to implement the interface, but the class itself will want to access a field as ImmutableArray<TKey>.
It would be great to continue to have the option to create the field, beside the option to initialize the Keys property.
Metadata
Metadata
Assignees
Labels
Area-IDEhelp 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