-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make coverage support incremental compilation #24773
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
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for working on this. Let me know when this is ready! Seems like github actions are having a tough day though, so we'll need to rerun some jobs. |
I want to port the tests as well, but I'm having trouble running the tests. I get: |
|
I think for coverage it should be |
|
@tgodzik Thank you. I needed to cleanup my workspace directory since I had last compiled Scala3 a long time ago and something was broken in the |
a3f67fd to
6ac0a8f
Compare
6ac0a8f to
2017109
Compare
|
@tgodzik I'm ready for review |
In capture checking, a type mismatch might happen for a synthesized tree (say from implicit search). It can be helpful to show this tree. Before capture checking a helpful message is less likely since we don't synthesize implicit trees that then don't match under the standard typing rules.
Fields are only allowed in stateful classes unless marked with @untrackedCaptures.
Co-authored-by: Oliver Bračevac <bracevac@users.noreply.github.com>
Previously, method type parameters were always renamed if they had the same name as any class type parameter, regardless of whether the class type parameter was actually used in the method signature. As a result, we rename methods's type params for unnecessary names like: scala#24671 (Note that renaming actually doesn't cause binary incompatibility, and this change is just for make generic signature a bit clear and silence false-positive MIMA reporting). For example, in an example below, the Scala compiler rename the generic signature of `bar` to something like `bar[T1](x: T1): T1` because `T` is used by `Foo[T]`. However, this is unnessary rename because none of T in method signature refer the `T` of `Foo[T]`. ```scala class Foo[T]: def bar[T](x: T): T = ??? ``` This commit makes the renaming conditional: Method type parameters are only renamed when - (1) A class type parameter is referenced in the method signature, and - (2) That class type parameter is shadowed by a method type parameter
Co-authored-by: Lukas Rytz <lukas.rytz@gmail.com>
Move isTypeParameterInMethSig as a local function and simplify it: collecting method type parameters by checking owner directly instead of searching the initialSymbol's typeParams list.
Add test cases for nested class generic signatures when method type parameters shadow enclosing class type parameters. The tests verify that Scala 3 correctly handles type parameter name conflicts in nested generic classes by renaming method-level type parameters to avoid clashing with outer class type parameters. Closes scala#24619
Port of scoverage/scalac-scoverage-plugin#742 for Scala 3.