airframe
airframe copied to clipboard
airspec: Bind test cases to lazy val to avoid too large method error in <init>
If the byte code of all test cases exceeds the 64k method-size limit of JVM, 'Method too large' compilation error can happen, especially in Scala 3.
To avoid this, each test case should use a different method body:
// test code
test { .... }
// current macro code expanded inside <init> < 64k JVM limit
addF0( ..test body)
// better: Define each test case using a separate method < 64k JVM Limit
lazy val __t000: AirSpecTestDef = testDefF0(... test body)
addF0(__t000)
I need to create a reproduction spec first. I've forgotten how I encountered this issue 😅