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

Clarify that modifyproperty! does not call convert #45178

Merged
merged 1 commit into from
May 6, 2022

Conversation

tkf
Copy link
Member

@tkf tkf commented May 4, 2022

Is this behavior documented somewhere?

julia> mutable struct Atomic{T}; @atomic x::T; end

julia> a = Atomic(0);

julia> @atomic a.x = 0.0;

julia> @atomic a.x += 0.0;
ERROR: TypeError: in modifyfield!, expected Int64, got a value of type Float64

I don't know if we should fix the documentation or the implementation. Or maybe note it as a possible future fix. So, just as a starter, I implemented the easiest change which is to simply document it.

@tkf tkf added docs This change adds or pertains to documentation multithreading Base.Threads and related functionality labels May 4, 2022
@tkf tkf requested a review from vtjnash May 4, 2022 07:22
@KristofferC KristofferC merged commit 350376b into JuliaLang:master May 6, 2022
@tkf
Copy link
Member Author

tkf commented May 6, 2022

Sorry, I should have clarified in the OP, but I think @vtjnash needed to approve this (although it's very likely the intended direction).

@aviatesk
Copy link
Sponsor Member

aviatesk commented May 6, 2022

yep sorry for my hasty approval😅

@tkf
Copy link
Member Author

tkf commented May 6, 2022

No worries :) I just quickly talked to @vtjnash but it wasn't clear what is the best direction. So, reverting it to play on the safer side: #45209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation multithreading Base.Threads and related functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants