Skip to content

Document the new fuel limit#3299

Open
SolalPirelli wants to merge 8 commits into
mainfrom
solal/fuel
Open

Document the new fuel limit#3299
SolalPirelli wants to merge 8 commits into
mainfrom
solal/fuel

Conversation

@SolalPirelli

@SolalPirelli SolalPirelli commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread _overviews/compiler-options/compiling-deeply-nested-code.md Outdated
Comment thread _overviews/compiler-options/fuel-and-stack-overflows.md Outdated
For **Scala 3.9 and newer**:
- If you get a `StackOverflowError`, and you did **not** set `-Xmax-fuel`, nor any JVM option related to stack space (when running on the JVM),
yes, that's a compiler bug, because the compiler should run out of fuel before hitting a stack overflow.
Please [report it](https://github.com/scala/scala3/issues/new/choose).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still not convinced we can nor should make that promise.

Co-authored-by: Matt Bovel <matthieu@bovel.net>
Comment thread _overviews/compiler-options/compiling-deeply-nested-code.md Outdated
@SethTisue

Copy link
Copy Markdown
Member

Maybe "Compiling Deeply Nested Code" (the goal) would be a better title than "Fuel and Stack Overflows" (the means)?

@SolalPirelli SolalPirelli requested review from bracevac and sjrd May 1, 2026 13:03
@SolalPirelli

Copy link
Copy Markdown
Contributor Author

@SethTisue good idea, done


For **Scala 3.9 and newer**:
- If you get a `StackOverflowError`, and you did **not** set `-Xmax-fuel`, nor any JVM option related to stack space (when running on the JVM),
yes, that's a compiler bug, because the compiler should run out of fuel before hitting a stack overflow.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is parser guarded by fuel?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything that currently uses handleRecursive on main to catch stack overflow is being migrated to use the fuel, doesn't look like this includes parser files though? https://github.com/scala/scala3/pull/25937/changes

@SolalPirelli SolalPirelli marked this pull request as ready for review May 26, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants