You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingSystem;usingSystem.Collections.Generic;usingSystem.Collections.Immutable;classC<TKey,TItem>// : IReadOnlyDictionary<TKey, TItem>{publicC(ImmutableArray<TItem>items,ImmutableArray<TKey>keys){}// Originally added via "Implement IReadOnlyDictionary<TKey, Item>"publicIEnumerable<TKey>Keys=>thrownewNotImplementedException();}
On the constructor parameter for keys, there is no "Create and assign field 'keys'" like there is for items. Instead, only "Initialize property 'Keys'":
usingSystem;usingSystem.Collections.Generic;usingSystem.Collections.Immutable;classC<TKey,TItem>// : IReadOnlyDictionary<TKey, TItem>{publicC(ImmutableArray<TItem>items,ImmutableArray<TKey>keys){Keys=keys;}// Originally added via "Implement IReadOnlyDictionary<TKey, Item>"publicIEnumerable<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.
The text was updated successfully, but these errors were encountered:
Version Used: Visual Studio 17.13.0 Preview 2.1
On the constructor parameter for
keys
, there is no "Create and assign field 'keys'" like there is foritems
. Instead, only "Initialize property 'Keys'":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 asImmutableArray<TKey>
.It would be great to continue to have the option to create the field, beside the option to initialize the Keys property.
The text was updated successfully, but these errors were encountered: