Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airspec: Bind test cases to lazy val to avoid too large method error in <init> #3170

Open
xerial opened this issue Aug 28, 2023 · 1 comment
Labels
kaizen code improvement without changing user-facing functionality
Milestone

Comments

@xerial
Copy link
Member

xerial commented Aug 28, 2023

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)
@xerial xerial changed the title airspec: Bind test cases to lazy val airspec: Bind test cases to lazy val to avoid too large method error in <init> Aug 28, 2023
@xerial xerial added this to the Airframe 24 milestone Jan 9, 2024
@xerial xerial added the kaizen code improvement without changing user-facing functionality label Jan 9, 2024
@xerial xerial mentioned this issue Jan 9, 2024
3 tasks
@xerial
Copy link
Member Author

xerial commented Jan 10, 2024

I need to create a reproduction spec first. I've forgotten how I encountered this issue 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kaizen code improvement without changing user-facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant