-
-
Notifications
You must be signed in to change notification settings - Fork 670
Compile virtual dependencies before finalizing stubs #2040
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
Conversation
Any test which test this issue? |
This one is ordering dependent and I haven't yet managed to create a reliable reproduction. Ordering changes in the affected fixtures however indicate that the mechanism fixes ordering. |
I see. |
There's a "minimal" reproduction here - about 8 typescript files. |
Giving the repro a first try, the fix appears to do what it is supposed to
but the call still produces an |
Turns out that issue with cross-dependencies runs even deeper. Was able to fix the remaining problem in an ugly way, but feels like there must be a better solution. |
What does it mean? It's problem with cyclic class dependencies? Like: |
There are multiple levels of dependencies that can be discovered, and the fix right now isn't catching all of them. Needs some sort of bookkeeping over multiple loops it seems, say starting at virtual calls and from there on continually checking which stub recently discovered more overloads while compiling until there is nothing left. The levels there are that both virtual calls as well as overloads that aren't itself virtual calls can be discovered, and either of them can discover the other. Kinda a result of the aggressive tree-shaking we do upfront. |
Now loops until no more virtual calls or overloads are discovered, which fixes the repro. |
Should fix #2034 by first compiling virtual overload dependencies so late cross-dependencies are not missed during stub finalization.