runtime (8): Add Scaladoc comments for undocumented entities - #26905
Draft
bvenners wants to merge 2 commits into
Draft
runtime (8): Add Scaladoc comments for undocumented entities#26905bvenners wants to merge 2 commits into
bvenners wants to merge 2 commits into
Conversation
Documents declarations that had no doc comment at all across scala.runtime: the boxed and unboxed value-class runtime support, the array and tuple helpers, and the 87 files of scala.runtime.java8 that back Java function interop. Comment-only: no declaration, body, import, annotation or blank line is touched.
Adjudicated from an independent review of this branch. Comment-only. - LazyVals.LazyValControlState was described as a state held only while a lazy val is unbound. NullValue is the permanent sentinel for a lazy val that evaluated to null, so it outlives the computation. - ModuleSerializationProxy said the resolved instance is cached per class. It is, through ClassValue, but the ClassValueCompat fallback recomputes on every access where java.lang.ClassValue is unavailable. - ArrayCharSequence.charAt can also throw for a slice whose bounds fall outside the array, since the constructor does not validate them, and toString takes its count from the declared bounds, so a negative start shifts the window rather than clipping it. - ScalaRunTime.isArray described atLevel as a minimum; below 1 it never holds. stringOf's maxElements renders nothing at all below 1. - StructuralCallSite.find can throw NoSuchMethodException from the reflective lookup a mega-morphic cache performs, and add records nothing and leaves the cache alone once the site is mega-morphic. - IntegralProxy.until and to documented only the zero-step failure; the same deferred length computation also throws for a range of more than Int.MaxValue elements. - Tuples.productToArray is called for arities 1 to 22; the empty tuple is handled separately with Array.emptyObjectArray. - VarArgsBuilder.result returns a sequence over the whole fixed-length array rather than only the elements added, and its n parameter is an allocation length that nothing enforces. Twenty-nine @return tags that merely restated a summary already beginning with "Returns" or "Creates" are removed, across TupledFunctions, TupleXXL, TupleMirror and the two Zipped iterables. The project's convention is to drop a @return in exactly that case. Declined: documenting, on each scala.runtime.java8 specialisation bridge, that unboxing null yields a zero and that a wrongly typed argument throws ClassCastException. Both are true of BoxesRunTime generally, these bridges are compiler-facing rather than called directly, and there are hundreds of them.
bvenners
force-pushed
the
scaladoc-missing-docs-runtime
branch
from
August 24, 2026 21:59
a194e42 to
74a56f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fills in a main doc comment plus @PARAM, @tparam, and @return tags for
scala.runtime,scala.runtime.java8andscala.runtime.coverageAPIs that are completely missing any Scaladoc documentation. Most of the files are the 87 ofscala.runtime.java8that back Java function interop; the rest is the value-class runtime support, the array and tuple helpers, and the rich wrapper classes. I'm submitting it as a draft PR so that I can get the CI to run on it, to see if it breaks anything, and to start getting feedback. We automated the generation of these changes and have not reviewed all of them yet. We will review them all before making the PR non-draft. Please let me know whether you think this is going in the right direction in general, and anything specific that you notice that could be improved.