Skip to content

Support deserialization of YAML anchors of value types#16186

Merged
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:feature/yaml-value-type-anchors
Oct 18, 2025
Merged

Support deserialization of YAML anchors of value types#16186
straight-shoota merged 1 commit intocrystal-lang:masterfrom
HertzDevil:feature/yaml-value-type-anchors

Conversation

@HertzDevil
Copy link
Contributor

Resolves #13830. All objects are now boxed so that they can be stored into the parse context uniformly.

This does not affect how the GC sees YAML::ParseContext#@anchors; since the hash's key type is String, Hash::Entry(String, T) is always non-atomic, thus the switch from UInt64 to Void* makes no differences. (In fact Void* is probably more correct here.)

YAML.parse already handles anchors regardless of their types, since they are all YAML::Anys; YAML::Nodes.parse returns a document and never resolves aliases. These methods are not affected in this patch.

@ysbaddaden ysbaddaden added this to the 1.19.0 milestone Oct 3, 2025
@Sija
Copy link
Contributor

Sija commented Oct 4, 2025

Would be a nice company to a #15941 given the slew of serialization-related changes in 1.18.0... ^^

@straight-shoota
Copy link
Member

We're past the merge window for 1.18, so this has to wait for 1.19.

@straight-shoota straight-shoota merged commit 5386020 into crystal-lang:master Oct 18, 2025
41 checks passed
@HertzDevil HertzDevil deleted the feature/yaml-value-type-anchors branch October 18, 2025 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

from_yaml does not support value type anchors

4 participants