Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalidate sources that depends on @inline methods #10633

Open
wants to merge 3 commits into
base: 2.13.x
Choose a base branch
from

Conversation

Friendseeker
Copy link
Contributor

@Friendseeker Friendseeker commented Dec 15, 2023

This PR fixes sbt/sbt#4125, sbt/zinc#537.

Issue

When @inline method implementation changes, the public API of @inline method does not change, hence Zinc does not invalidate sources that depends on @inline method.

Solution

The behaviour of @inline method is similar to macro methods. Hence, we can mark @inline method as macro and reuse existing Zinc invalidation logic for macro invalidation.

Validating the fix

Scripted test is added to Zinc side (sbt/zinc#1310). The test passed.

TODOs

  • This PR does not handle call-site @inline. To handle that case, we need to follow -opt:l:inline breaks incremental compilation sbt/zinc#537 (comment) and drop call-site @inline at compiler side.
  • Even without @inline annotation, compiler may still sometimes inline a method. The compiler keep a log of inlined methods, so in a follow up PR, we can utilize that information instead of directly checking @inline annotation.

@scala-jenkins scala-jenkins added this to the 2.13.14 milestone Dec 15, 2023
@SethTisue
Copy link
Member

(This looks attractive — and thank you! — but let's get 2.13.13 out the door first.)

@SethTisue SethTisue modified the milestones: 2.13.14, 2.13.15 Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants