Skip to content

fix(printer): check Alias func instead of Anchor for alias token#886

Open
SAY-5 wants to merge 1 commit into
goccy:masterfrom
SAY-5:fix-printer-alias-nil-guard
Open

fix(printer): check Alias func instead of Anchor for alias token#886
SAY-5 wants to merge 1 commit into
goccy:masterfrom
SAY-5:fix-printer-alias-nil-guard

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 9, 2026

Copy link
Copy Markdown

The alias branch in (*Printer).property guarded on p.Anchor != nil but then called p.Alias(). A printer that sets a custom Anchor func while leaving Alias nil panics with a nil func call when it reaches an alias token, instead of falling through to the default property (issue #876). Switched the guard to p.Alias != nil to match the equivalent case in the PreviousType switch just above.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@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.65%. Comparing base (edee2f9) to head (8edfdcd).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #886   +/-   ##
=======================================
  Coverage   80.65%   80.65%           
=======================================
  Files          22       22           
  Lines        6845     6845           
=======================================
  Hits         5521     5521           
  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.

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