Skip to content

fix optional type set before get #46

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

Merged
merged 2 commits into from
Nov 28, 2024
Merged

Conversation

mlch911
Copy link
Contributor

@mlch911 mlch911 commented Nov 27, 2024

When we have a optional type var with default value. We may set it before call get. So the value will change to the default Value.

@AssociatedObject(.retain(.atomic))
var string: String? = "text"

string = "abc"
print(string) // => text ❌

# Conflicts:
#	Sources/AssociatedObjectPlugin/AssociatedObjectMacro.swift
Copy link
Owner

@p-x9 p-x9 left a comment

Choose a reason for hiding this comment

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

Thank you.
I have made one comment on the improvement suggestion, please check it out.

@p-x9
Copy link
Owner

p-x9 commented Nov 28, 2024

Thanks for the fix.

@p-x9 p-x9 merged commit 4b0758d into p-x9:main Nov 28, 2024
2 checks passed
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.

2 participants