Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Surface (fix): __sXXX is a forward reference extending over the defin…
…ition of __sYYY in methodsOf (#3451) In some complex classes I get errors like "__s239 is a forward reference extending over the definition of __s041" when using `methodsOf` in Scala 3 on them. This is because `CompileTimeSurfaceFactory.methodsOf` lists the methods in the `seen` order. Some of them are declared as `val`, some as `lazy val`. While `lazy val` can reference each other freely, they cannot do so across a barrier of `val`. This change makes sure the `lazy val`s (non-lazy surfaces) are listed first. I have verified this fixes the issue for my complex class (about 400 members). I will try to create a standalone open-source repro later if possible - this will probably need some mixture of methods with lazy and non-lazy surfaces used for types. I did not check Scala 2 implementation as I am not using Surface on Scala 2 - it is possible it experiences the same issue. If there is a test, this should show up. --------- Co-authored-by: Taro L. Saito <[email protected]>
- Loading branch information