-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Partial properties: duplicate membersByName
before merging accessors
#74969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
membersByName = new Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>>(membersByName, ReadOnlyMemoryOfCharComparer.Instance); | ||
} | ||
|
||
DuplicateMembersByNameIfCached(ref membersByName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, membersByName
was modified in mergeAccessors
before duplicating.
membersByName[name] = FixPartialMember(membersByName[name], prevProperty, currentProperty); | ||
} | ||
|
||
void mergeAccessors(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, ReadOnlyMemory<char> name, SourcePropertyAccessorSymbol? currentAccessor, SourcePropertyAccessorSymbol? prevAccessor) | ||
void mergeAccessors(ref Dictionary<ReadOnlyMemory<char>, ImmutableArray<Symbol>> membersByName, SourcePropertyAccessorSymbol? currentAccessor, SourcePropertyAccessorSymbol? prevAccessor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also seems like this function could take membersByName
by value instead.
Duplicate
membersByName
dictionary before modifying inmergeAccessors
if the dictionary is cached.Note, the potential race condition is speculative. I'm not aware of a reported issue, and I have not been able to create a test that hits an issue here.
Relates to test plan #73090