Skip to content

Fix UndefRefError in get for abstract-typed ScopedValue (#34)#35

Merged
vchuravy merged 2 commits into
mainfrom
vc/fix_get_abstract
Apr 28, 2026
Merged

Fix UndefRefError in get for abstract-typed ScopedValue (#34)#35
vchuravy merged 2 commits into
mainfrom
vc/fix_get_abstract

Conversation

@vchuravy

Copy link
Copy Markdown
Member

Code reviewed manually by me, adopted from current Base by Claude.

vchuravy and others added 2 commits April 28, 2026 20:24
When `isassigned` returned true because a scope contained the value (not
because `has_default` was set), the old implementation still passed
`val.default` as the fallback to `Base.get`. For abstract type parameters,
this field is uninitialized when no default was provided, causing an
`UndefRefError`. Fix by gating all access to `val.default` behind a
`val.has_default` check, mirroring the upstream Julia implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vchuravy vchuravy requested a review from JamesWrigley April 28, 2026 18:26
@vchuravy

Copy link
Copy Markdown
Member Author

@iamed2 can you take this for a spin?

@iamed2

iamed2 commented Apr 28, 2026

Copy link
Copy Markdown

Yes I'll try it out. Thank you for this fix!

@JamesWrigley JamesWrigley left a comment

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.

Sorry about that, I didn't think to check if get() needed updating 😬 LGTM!

@iamed2

iamed2 commented Apr 28, 2026

Copy link
Copy Markdown

Verified to take AWS.jl's tests from failing to passing on Julia 1.10.11!

@vchuravy vchuravy merged commit cbb4ef6 into main Apr 28, 2026
15 checks passed
@vchuravy vchuravy deleted the vc/fix_get_abstract branch April 28, 2026 20:06
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