Skip to content
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

Fixed associated object key issues in release builds #40

Merged
merged 2 commits into from Apr 3, 2024

Conversation

p-x9
Copy link
Owner

@p-x9 p-x9 commented Apr 2, 2024

#39
In the release build, there was a problem with duplicate keys due to inline expansion of functions.
Fixed to use function pointers to ensure uniqueness

@p-x9 p-x9 changed the title Fixed related object key issues in release builds Fixed associated object key issues in release builds Apr 2, 2024
Comment on lines +1094 to +1116
func testKeysUnique() {
let keys = [
ClassType.__associated_intKey,
ClassType.__associated_doubleKey,
ClassType.__associated_stringKey,
ClassType.__associated_boolKey,
ClassType.__associated_optionalIntKey,
ClassType.__associated_optionalDoubleKey,
ClassType.__associated_optionalStringKey,
ClassType.__associated_optionalBoolKey,
ClassType.__associated_implicitlyUnwrappedStringKey,
ClassType.__associated_intArrayKey,
ClassType.__associated_doubleArrayKey,
ClassType.__associated_stringArrayKey,
ClassType.__associated_boolArrayKey,
ClassType.__associated_optionalIntArrayKey,
ClassType.__associated_optionalDoubleArrayKey,
ClassType.__associated_optionalStringArrayKey,
ClassType.__associated_optionalBoolArrayKey,
ClassType.__associated_classTypeKey,
]
XCTAssertEqual(Set(keys).count, keys.count)
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if generated keys is uniqued.

@p-x9 p-x9 merged commit fd5e39a into main Apr 3, 2024
2 checks passed
@p-x9 p-x9 deleted the feature/fix-key-on-release-build branch April 3, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant