Skip to content

test/goroot: match missing-comma recovery diagnostics - #2218

Merged
cpunion merged 2 commits into
xgo-dev:mainfrom
cpunion:codex/xfail-compile-errorcheck-20260730
Jul 30, 2026
Merged

test/goroot: match missing-comma recovery diagnostics#2218
cpunion merged 2 commits into
xgo-dev:mainfrom
cpunion:codex/xfail-compile-errorcheck-20260730

Conversation

@cpunion

@cpunion cpunion commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • pair the gc-style missing-comma primary with the exact duplicate emitted by go/parser
  • keep matching scoped to the same canonical source, line, and exact secondary text
  • enable fixedbugs/issue14520.go and syntax/composite.go in Go 1.26 errorcheck coverage

Correctness

The secondary is discarded only after the expected primary matched. A secondary by itself, a near-match, a different source/line, or an extra duplicate remains an error.

Validation

  • targeted harness unit tests on Go 1.24.11, 1.25.0, and 1.26.0
  • both GOROOT cases on Go 1.24.11, 1.25.0, 1.26.0, and 1.26.5
  • original 149 compile/errorcheck xfail cases on Go 1.26.0: 2 pass and the remaining 147 stay expected failures
  • go test ./test/goroot

Scope and overlap

No functional dependency on another PR. This does not touch interface/assertinline.go, which is handled by #2201, and does not include wasm or DWARF changes.

The Ubuntu Go workflow currently needs #2215 to install libslirp.so.0 for ESP QEMU verification. This PR does not duplicate that CI fix.

The seven compile xfails remain intentionally unchanged: their checkptr, libfuzzer, softfloat, and dynlink flags carry compiler semantics and should not be accepted as no-ops.

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: test/goroot: match missing-comma recovery diagnostics

Reviewed the diff across code quality, performance, security, and documentation accuracy.

Clean, well-scoped change. The two new parserRecoverySecondaries cases (composite literal, parameter list) follow the existing pairing convention exactly: a secondary is discarded only after its gc-style primary matched on the same file+line with exact secondary text, and parserRecoveryPair.consumed ensures only one duplicate is dropped. The comment reword (dropping "the five") is a correct fix now that the switch handles more spellings. No performance, security, or documentation-accuracy concerns.

Two minor test-quality notes are inline. Neither is a correctness bug — the harness pairing logic is exercised correctly and the PR reports validation of both enabled cases across Go 1.24.11 / 1.25.0 / 1.26.0 / 1.26.5.

Comment thread test/goroot/runner_unit_test.go Outdated
Comment thread test/goroot/runner_unit_test.go
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cpunion
cpunion force-pushed the codex/xfail-compile-errorcheck-20260730 branch from 66e8e27 to d87434b Compare July 30, 2026 01:15
@cpunion
cpunion merged commit fc72116 into xgo-dev:main Jul 30, 2026
39 checks passed
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.

1 participant