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

Scala 3: Zinc does not fully propagate changes to inline methods #1000

Closed
informarte opened this issue Sep 5, 2021 · 2 comments
Closed

Scala 3: Zinc does not fully propagate changes to inline methods #1000

informarte opened this issue Sep 5, 2021 · 2 comments

Comments

@informarte
Copy link

versions

Scala 3.0.1, Mill 0.9.9, Zinc 1.5.5

steps

Put the following objects into separate files:

object A {
  inline def f(x: Int) = x * 2
  def main(args: Array[String]): Unit = {
    println(f(10))
  }
}

object B {
  inline def g(x: Int) = A.f(x) * 2
  def main(args: Array[String]): Unit = {
    println(g(10))
  }
}

object C {
  inline def h(x: Int) = B.g(x) * 2
  def main(args: Array[String]): Unit = {
    println(h(10))
  }
}

Compile and run C.main; the output is 80.

problem

Now change the constant in A.f to 4 and recompile. Only 2 files get recompiled and the output of C.main is still 80.

expectation

After changing A.f, all files get recompiled and the output of C.main is correct.

notes

There seems to be now way to disable inlining in Scala 3. Hence it is very important that incremental compilation produces a correct result when an inlined method was changed. At the very least, a full rebuild should be triggered.

@smarter
Copy link
Contributor

smarter commented Sep 5, 2021

Duplicate of scala/scala3#11861 (incremental compilation in scala 3 is implemented in the compiler repository, not in zinc's repository) Also note that there's an open pr for this issue: scala/scala3#12931

@smarter smarter closed this as completed Sep 5, 2021
@informarte
Copy link
Author

Good to know, thanks.

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

No branches or pull requests

2 participants