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

Stress test for add-class-deps (#18958) #19015

Closed
wants to merge 9 commits into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Nov 21, 2023

Based on #18958 with one additional commit.

This commit marks all explicitly declared vals tracked. It causes many test failures, which
makes it unlikely that we will be able to do this in the end. But it's an excellent basis
for stress testing the implementation of dependent classes.

The idea is to

  • look at the test failures in this test
  • convert each failing test into a test with explicit tracked modifiers and compile with Pre SIP: Improvements to Modularity #18958.
  • if the test still fails (it probably will), try to fix the root cause
    or determine that the pattern should not be supported.

Some test cases that demonstrate that Scala's type system is currently not precise enough when it comes to
dependent classes.
For a tracked class parameter we add a refinement in the constructor type that
the class member is the same as the parameter. E.g.
```scala
class C { type T }
class D(tracked val x: C) { type T = x.T }
```
This will generate the constructor type:
```scala
(x1: C): D { val x: x1.type }
```
Without `tracked` the refinement would not be added. This can solve several problems with dependent class
types where previously we lost track of type dependencies.
Needs an addition to Tasty format: TRACKED as a modifier.
This commit makes all explicitly declared vals tracked. It causes many test failures, which
makes it unlikely that we will be able to do this in the end. But it's an excellent basis
for stress testing the implementation of dependent classes.

The idea is to

 - look at the test failures in this test
 - convert failing tests into tests witih explicit tracked annotations
 - if the test still fails (it probably will), try to fix the root cause
   or determine that the pattern should not be supported.
@odersky
Copy link
Contributor Author

odersky commented Nov 21, 2023

I probably won't have time to work on this. If we want to make progress here it would be good to have somebody pick up.

@odersky odersky marked this pull request as draft November 21, 2023 22:43
@odersky odersky closed this Jan 6, 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
Development

Successfully merging this pull request may close these issues.

1 participant