WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@hamzaremmal
Copy link
Member

@hamzaremmal hamzaremmal commented Dec 16, 2025

The idea of using scala.runtime.Statics.ioobe was to reduce the size of the generated bytecode.
In this PR, we instead use the JDK9+ constructor of IndexOutOfBoundsException.
In the generated code, checkcast mentioned in scala/scala#7086 (comment) is also not present making the generated code more efficient than what it looked like in Scala 2.

One question remains, should we deprecate scala.runtime.Statics.ioobe? I believe we should I did deprecate it.

public static final <T> T ioobe(int n) throws IndexOutOfBoundsException {

Closes #23971

@hamzaremmal hamzaremmal added this to the 3.10.0 milestone Dec 16, 2025
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.

use scala.runtime.Statics.ioobe. forward port of Scala 2 #7086

1 participant