-
Notifications
You must be signed in to change notification settings - Fork 121
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
Changing class parameters doesnt recompile dependent code #1334
Comments
fyi @Gedochao, as the root cause may be in the Dotty repo |
Hmm, I noticed another similar issue.. |
It's not a Mill issue btw, I've added sbt too, same issue.
|
@sake92 Would something like the following be an example? class MyService(str: String, i: Int) Like Seth suggested, likely this is more to do with the compiler bridge issue, and not specific to the build tools that calls into Zinc like Mill or sbt. |
val service = MyService("fssdfs") My guess is that the new |
Actually adding
|
I suggest reporting this to https://github.com/scala/scala3/issues. |
Thanks for checking @eed3si9n . |
Fixes #19910 Fixes sbt/zinc#1334 ## Problem Scala 3 compiler registers special `zincMangledName` for constructors for the purpose of incremental compilation. Currently the `zincMangledName` contains the package name, which does not match the use site tracking, thereby causing undercompilation during incremental compilation after a ctor change, like adding a parameter. There is an existing scripted test, but coincidentally the test class does NOT include packages, so the test ends up passing. ## Solution 1. This PR reproduces the issue by adding package name to the test. 2. This also fixes the problem by changing the `zincMangedName` to `sym.owner.name ++ ";init;"`. ## Note about zincMangedName `zincMangedName` in general is a good idea, which adds the class name into otherwise common name `<init>`. By making the name more unique it prevents overcompilation when one of the ctors changes in a file.
Fixed by scala/scala3#19911 |
steps
problem
Hello still compiles.
expectation
Hello should not compile.
notes
Seems to be scala 3 related. It works with 2.13 for example
Original issue in Metals: scalameta/metals#6112
The text was updated successfully, but these errors were encountered: