wvlet / airframe

Essential Building Blocks for Scala

Home Page:https://wvlet.org/airframe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

surface: Remove redundant suface generation

xerial opened this issue · comments

Surface.methodOf[X] may cause "bytecode too large" error because it always generate Surface generation code in Scala 3. In Scala 2, runtime-reflection was used to compute Surface at run-time, so the bytecode was small.

A basic approach would be:

  • Collect all input and return types
  • Generate Surface without redundancy and put them in a Set
  • Build MethodSurface using the pre-build Surfaces