Skip to content

Change isassigned() to match the Base definition#32

Merged
vchuravy merged 1 commit intoJuliaLang:mainfrom
JamesWrigley:isassigned
Apr 27, 2026
Merged

Change isassigned() to match the Base definition#32
vchuravy merged 1 commit intoJuliaLang:mainfrom
JamesWrigley:isassigned

Conversation

@JamesWrigley
Copy link
Copy Markdown
Member

ScopedValues.jl previously used isassigned() to check if a ScopedValue had a default value, but that differs from Base which uses isassigned() to check if a ScopedValue is initialized in the current scope.

Fixes this behaviour:

julia> using ScopedValues

julia> x = ScopedValue{Int}()
ScopedValue{Int64}(undefined)

julia> isassigned(x)
false

# On 1.11+ this returns true
julia> @with x => 1 isassigned(x)
false

This is technically a breaking change, but I would consider it a bugfix to match Base. It came up in the wild when using ScopedValues.jl in DistributedNext (JuliaParallel/DistributedNext.jl#17).

ScopedValues.jl previously used `isassigned()` to check if a `ScopedValue` had a
default value, but this differs from Base which uses `isassigned()` to check if
a `ScopedValue` is initialized in the current scope.
@JamesWrigley
Copy link
Copy Markdown
Member Author

(bump)

2 similar comments
@JamesWrigley
Copy link
Copy Markdown
Member Author

(bump)

@JamesWrigley
Copy link
Copy Markdown
Member Author

(bump)

@vchuravy
Copy link
Copy Markdown
Member

Semantic change in Base in JuliaLang/julia#53022 present since v1.11.0-alpha1

@vchuravy vchuravy merged commit b763478 into JuliaLang:main Apr 27, 2026
15 checks passed
@JamesWrigley JamesWrigley deleted the isassigned branch April 27, 2026 20:55
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