-
Notifications
You must be signed in to change notification settings - Fork 731
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
fix: @dynamicMember
conflicting field name
#2965
Conversation
✅ Deploy Preview for apollo-ios-docs canceled.
|
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.
Thanks so much for getting this one out @calvincestari!
@@ -68,6 +69,19 @@ struct MockObjectTemplate: TemplateRenderer { | |||
""" | |||
} | |||
|
|||
private func conflictingFieldNameProperties(_ fields: [TemplateField]) -> TemplateString { | |||
""" | |||
\(fields.map { """ |
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.
Nit: might be more performant to compute an intersection with the TestMockConflictingFieldNames
set and then just map over those? I could be wrong, but I believe that set intersection computation is very fast b/c of hashing algorithms. This is so so minor though, I'm not really worried about making the change.
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.
Nothing about fields
nor the FieldCollector
is a Set
unfortunately, I don't think we're going to get much benefit out of going that route here.
0929a0a
to
0c6ca47
Compare
Fixes #2950
@dynamicMember
subscript.Mock
subscript setters to use a common private_set
function that can be called from initializers too.