Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not bring forward symbols created in transform and backend phases (#…
…21865) In the i21844 issue minimization, first the `Macro.scala` and `SuperClassWIthLazyVal.scala` compilation units are compiled, then in the next run `SubClass.scala` is compiled. While compiling `SuperClassWIthLazyVal.scala`, in the `LazyVals` transform phase, the lzyINIT initialization fields are created. In the next run, while compiling `SubClass.scala`, in the `GenBCode` phase, the compiler would try to access the lzyINIT symbol, leading to a stale symbols crash. While that symbol was a part of the SuperClass, it by design is not generated for the Subclass - if we were to completely split those files into 2 separate compilations, that symbol would be created only for the classfile, but it would not be included in tasty, so the second compilation would not try to access it. This observation inspires the proposed fix, where if the symbol was first created in or after the first transform phase (so after the pickler phases), we do not try to bring forward this denotation, instead returning NoDenotation. In this PR, we also remove the fix proposed in i21559, as it is no longer necessary with the newly added condition. There, since one of the problematic Symbols created in `LazyVals` was moved elsewhere in `MoveStatics`, we checked if that symbol could be found in a companion object. I was not able to create any reproduction where a user defined static would produce this problem, so I believe it’s safe to remove that.
- Loading branch information