Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Sep 11, 2025

Fixes #23852
Closes #19426

Around a year ago a new DependencyContext value was added to the zinc api: DependencyByMacroExpansion.
It causes the recorded dependency to trigger recompilation if there is any API change in the recorded type, not just if the feudal/method member that was explicitly referenced was changed. So now, for every inline call:
macroCall[T1, T2, ...], in file call.scala, if anything changes in a TN definition, call.scala is recompiled.

Since DependencyByMacroExpansion was added later to the API, referencing it in older versions (e.g. any sbt < 1.10.0), would cause crashes. to avoid that, we use reflection to check if that field exists.

These changes do not seem to affect #23783, likely the way annotations are handled needs to be changed in zinc itself, as the APIInfo phase does successfully record the change in the annotation argument.

Related discussion: sbt/zinc#1316 (a PR adding the functionality to zinc and scala-2 plugin).

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.

Macro usage is not invalidated Test impact of macros on incremental compilation when type parameter changes
2 participants