Skip to content

chore(compiler): add top-level object dependency regression test - #26756

Open
nguyenyou wants to merge 1 commit into
scala:mainfrom
nguyenyou:codex/top-level-object-binary-dependency-test
Open

chore(compiler): add top-level object dependency regression test#26756
nguyenyou wants to merge 1 commit into
scala:mainfrom
nguyenyou:codex/top-level-object-binary-dependency-test

Conversation

@nguyenyou

@nguyenyou nguyenyou commented Aug 9, 2026

Copy link
Copy Markdown

This adds a regression test for binary dependencies loaded from TASTy.

For a top-level object, the compiler reports binary name example.Api$ with Api.class; the defining file is Api$.class. Zinc can therefore detect a false classpath change and recompile downstream sources.

The new test intentionally fails with expected: Api$.class, actual: Api.class.

Have you relied on LLM-based tools in this contribution?

Yes, extensively. I first noticed the problem while using Mill: changing one source file caused incremental compilation to recompile five files. I asked Codex GPT-5.6 Sol (Extra High) and Claude Fable 5 (High) to investigate.

Both reached the same diagnosis and agreed on this regression test. I verified their work by reproducing the behavior locally, reviewing the dependency callback output, and running the focused test.

How was the solution tested?

This PR does not include a fix. It adds a minimal regression test that reproduces the bug and intentionally fails on main; CI should confirm the failure.

I do not have sufficient expertise in this compiler area to propose a reliable fix. Instead of opening an issue with a separate reproducer, I am submitting the reproducer directly as a test so maintainers can investigate and use it to validate the eventual fix.

If the project prefers an issue before proceeding with this PR, I am happy to file one.

Add a focused Zinc callback test for the class file paired with a top-level object binary name.

LLM assistance: Codex helped investigate and write the test; the callback data and targeted test result were reviewed locally.

Co-Authored-By: Codex GPT-5.6 Sol (Extra High) <codex@openai.com>
@scala-cla-bot

scala-cla-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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