Skip to content

test/goroot: cover loader frontend diagnostics#2102

Merged
xushiwei merged 1 commit into
xgo-dev:mainfrom
cpunion:codex/xfail-loader-diagnostics
Jul 20, 2026
Merged

test/goroot: cover loader frontend diagnostics#2102
xushiwei merged 1 commit into
xgo-dev:mainfrom
cpunion:codex/xfail-loader-diagnostics

Conversation

@cpunion

@cpunion cpunion commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • cover 5 Go 1.26 loader/import/embed errorcheck cases and retire their xfails
  • keep pure go/types versus cmd/compile/types2 wording aliases in the GOROOT test harness:
    • non-canonical import-path punctuation
    • cross-package field/method quoting and nearby-name suggestions
  • keep product-code changes limited to diagnostics that reflect real compiler behavior:
    • reject absolute import paths instead of leaking the loader's no metadata detail
    • preserve cmd/compile's semantic-error precedence for local go:embed variables and pre-Go-1.16 language mode when go list validates the trailing pattern first

The loader no longer rewrites general go/types or driver diagnostics. Ordinary malformed imports, field diagnostics outside GOROOT errorcheck matching, and current-version embed pattern failures retain their native llgo/go/packages output.

Cases

  • fixedbugs/issue11362.go: GOROOT-only wording alias
  • fixedbugs/issue31053.dir/main.go: GOROOT-only wording aliases
  • import6.go: loader absolute-import validation
  • embedvers.go: loader/compiler diagnostic precedence
  • embedfunc.go: loader/compiler diagnostic precedence

Validation

The default Go 1.26.5 vet invocation still panics in its vendored x/tools/refactor/satisfy on unchanged main; the affected integration tests therefore use -vet=off.

@cpunion cpunion added progress go-test-compat Go standard-library and GOROOT test compatibility go1.26 Go 1.26 compatibility and support and removed progress labels Jul 16, 2026
@codecov

codecov Bot commented Jul 16, 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-loader-diagnostics branch 3 times, most recently from df93d1b to 08149e0 Compare July 17, 2026 06:21
@cpunion cpunion changed the title packages: normalize compiler loader diagnostics test/goroot: cover loader frontend diagnostics Jul 17, 2026
@cpunion
cpunion force-pushed the codex/xfail-loader-diagnostics branch from 08149e0 to e0baece Compare July 17, 2026 08:13
@cpunion
cpunion force-pushed the codex/xfail-loader-diagnostics branch from e0baece to 92ce205 Compare July 17, 2026 09:47
@xushiwei
xushiwei merged commit e6156d3 into xgo-dev:main Jul 20, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go1.26 Go 1.26 compatibility and support go-test-compat Go standard-library and GOROOT test compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants