Skip to content

fix(decoder): accept anchored null pointer fields - #990

Closed
Narek-Khachikyan wants to merge 1 commit into
goccy:masterfrom
Narek-Khachikyan:fix/anchored-null-pointers
Closed

Narek-Khachikyan wants to merge 1 commit into
goccy:masterfrom
Narek-Khachikyan:fix/anchored-null-pointers

Conversation

@Narek-Khachikyan

@Narek-Khachikyan Narek-Khachikyan commented Nov 8, 2026 •

Copy link
Copy Markdown

Anchored null values currently fail to decode into pointer fields with "null was used where mapping is expected". Preserve the pointer type when allocating the destination for an anchored null, so null handling can leave it nil and aliases reuse that value.

Fixes #750.

Local proof: the regression failed before the fix and passes for null and ~, with nil and initialized pointers. go test -race ./..., validator integration tests, go vet ./..., and make lint pass.

CI limitation: the macOS race job aborts before the root package tests start with missing LC_UUID load command. The same loader failure appears in an earlier unrelated run. Matrix fail-fast cancels other race jobs.

  • Describe the purpose for which you created this PR.
  • Create test code that corresponds to the modification

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.66%. Comparing base (edee2f9) to head (a474c62).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #990   +/-   ##
=======================================
  Coverage   80.65%   80.66%           
=======================================
  Files          22       22           
  Lines        6845     6848    +3     
=======================================
+ Hits         5521     5524    +3     
  Misses        905      905           
  Partials      419      419           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Narek-Khachikyan Narek-Khachikyan closed this by deleting the head repository Nov 9, 2026
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.

Unmarshalling yaml into struct with null anchor causes error

2 participants