wvlet / airframe

Essential Building Blocks for Scala
https://wvlet.org/airframe
Apache License 2.0
632 stars 66 forks source link

surface: Fix #3454 - methods in generic classes - for Scala 3 #3455

Closed OndrejSpanel closed 6 months ago

OndrejSpanel commented 7 months ago

This PR implements a test and Scala 3 fix of #3454. The major part of the fix is a simplification of typeMappingTable function. I am not 100% sure what the previous implementation using method.paramSymss was trying to do, I only hope whatever it was, it had tests in place for that.

@xerial The new test fails on Scala 2 - if you or anyone is interested in completing the fix, feel free to continue.

OndrejSpanel commented 7 months ago

Note: like #3466 this avoid using .tree and provides a simpler implementation of typeMappingTable. I have cherrypicked the typeMappingTable simplification into #3466 from here.

The rest (resolving method types) stays only here.

xerial commented 6 months ago

As we don't need to support everything for Scala 2 as well, we can put the test case under src/test/scala-3 folder to pass the CI

OndrejSpanel commented 6 months ago

Rebased, test moved to Scala 3. Should be ready to go.