-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Zinc invalidation when nested inline method changes #11861
Comments
Actually I have the same behavior with: case class Show(name: String)
object Show:
inline def foo: Show = bar
inline def bar: Show = Show("foo") @main def app() =
println(Show.foo.name) |
Currently, the API hash of an inline method contains a hash of the body of the method: https://github.com/lampepfl/dotty/blob/c0b3fde1dbe9a8ef3b87ddfaa873ea945beafa8c/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala#L588-L682 I think we need to go further and also recursively include the bodies of inline methods called from this method, keeping in mind that this requires maintaining a set of seen methods to make sure we don't recurse infinitely. (This is a bit annoying since it means we need to traverse the same inline method multiple times every time we see it called from some other inline method, but any solution that tries to reuse hashes is bound to be very complicated because we can have mutually-recursive inline methods that can even be defined in separate compilation units) |
so there is no issue with inlining being later now - we can still access the bodies |
I suspect this issue to be the cause of deffered inline methods when changing the implementation then recompiling but works when recompiling the entire project. |
Fix #11861 - hash nested calls to inline definitions
Compiler version
Latest nightly:
Minimized code
Output
private inline foo
methodThe
app.scala
file is not invalidated and thus not recompiled.The produced program should print "bar" instead of "foo".
Expectation
The
app.scala
file should be recompiled.The text was updated successfully, but these errors were encountered: