scala3
scala3 copied to clipboard
Support Mirror synthesis for local and inner classes
A new PR which takes a simpler approach - compute a prefix for the child and use asSeenFrom
- update child accessibility check for anonymous mirrors in whyNotGenericSum. Now check the prefix at the callsite can access the child.
- for sum mirrors, compute a new prefix for each child from the callsite prefix of the parent, see TypeOps.childPrefix. For each child, subsititute its prefix at definition with the childPrefix using asSeenFrom. For polymorphic classes, perform the subsitution on the constructor before inferring constraints.
- add tests for issues 13332, 13935, 11174, 12328
- add tests for local/inner classes taken from Shapeless for its Generic type, backed by mirrors
fixes https://github.com/lampepfl/dotty/issues/13332 fixes https://github.com/lampepfl/dotty/issues/12328 fixes https://github.com/lampepfl/dotty/issues/11174 fixes https://github.com/lampepfl/dotty/issues/13935
test performance please
performance test scheduled: 1 job(s) in queue, 0 running.
Performance test finished successfully:
Visit https://dotty-bench.epfl.ch/15847/ to see the changes.
Benchmarks is based on merging with main (e560c2d697)
should this be back ported to 3.2.0 - e.g. 3.2.0 won't be able to summon a mirror for a local class compiled by 3.2.1, so that makes it a forward source compatibility breaking change
doing the backport PR now