Skip to content

runtime (8): Add Scaladoc comments for undocumented entities - #26905

Draft
bvenners wants to merge 2 commits into
scala:mainfrom
artimahub:scaladoc-missing-docs-runtime
Draft

runtime (8): Add Scaladoc comments for undocumented entities#26905
bvenners wants to merge 2 commits into
scala:mainfrom
artimahub:scaladoc-missing-docs-runtime

Conversation

@bvenners

Copy link
Copy Markdown
Contributor

This PR fills in a main doc comment plus @PARAM, @tparam, and @return tags for scala.runtime, scala.runtime.java8 and scala.runtime.coverage APIs that are completely missing any Scaladoc documentation. Most of the files are the 87 of scala.runtime.java8 that 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.

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
bvenners force-pushed the scaladoc-missing-docs-runtime branch from a194e42 to 74a56f9 Compare August 24, 2026 21:59
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.

1 participant