Skip to content

atomics: fix some minor issues#42335

Merged
vtjnash merged 1 commit intomasterfrom
jn/atomic-minor-fix
Sep 22, 2021
Merged

atomics: fix some minor issues#42335
vtjnash merged 1 commit intomasterfrom
jn/atomic-minor-fix

Conversation

@vtjnash
Copy link
Copy Markdown
Member

@vtjnash vtjnash commented Sep 21, 2021

No description provided.

@vtjnash vtjnash requested a review from tkf September 21, 2021 21:58
}
if (!jl_subtype(ret.typ, jltype)) {
emit_typecheck(ctx, ret, jltype, fname + "typed_store");
emit_typecheck(ctx, ret, jltype, fname);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So this fixes the error message

julia> mutable struct AtomicRef{T}
           @atomic value::T
       end

julia> function f!(r)
           + = (_, x) -> x
           @atomic r.value += :a
       end;

julia> f!(r)
ERROR: TypeError: in modifyfield!typed_store, expected Int64, got a value of type Symbol

to TypeError: in modifyfield!, expected Int64...? Sounds like an improvement to me!

@vtjnash vtjnash merged commit 1e6c269 into master Sep 22, 2021
@vtjnash vtjnash deleted the jn/atomic-minor-fix branch September 22, 2021 15:24
KristofferC pushed a commit that referenced this pull request Sep 23, 2021
KristofferC pushed a commit that referenced this pull request Sep 28, 2021
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
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.

3 participants