Skip to content

Conversation

@WojciechMazur
Copy link
Contributor

Backports #24709 to the 3.8.0-RC4.

PR submitted by the release tooling.
[skip ci]

This was already the case for the select rule optimization in recheckSelection
but was missing for the corresponding rule for applications.

This caused one regression in the standard library, here:
```
  private def eagerHeadConcatIterators[A](it: Iterator[collection.Iterable[A]^]^): LazyListIterable[A]^{it} =
    if !it.hasNext then Empty
    else
      eagerHeadPrependIterator
          (it.next().iterator)
          (eagerHeadConcatIterators(it))
```
Previously the access to `it.next()` was considered to have type `it` by applying the apply rule
incorrectly. It should be `it*`. This means we now have `it*` instead of `it` in the result type
and we also have an illegal use of `it*` leaking outside `eagerHeadConcatIterators`. The second
problem was fixed by adding an unsafe escape hatch `unsafeDiscardUses` that suppressed use recording.
This leads to:
```
  private def eagerHeadConcatIterators[A](it: Iterator[collection.Iterable[A]^]^): LazyListIterable[A]^{it*} =
    if !it.hasNext then Empty
    else
      eagerHeadPrependIterator
          (caps.unsafe.unsafeDiscardUses(it.next()).iterator)
          (eagerHeadConcatIterators(it))
```
This also did not compile since it claimed that the `it @reachCapability` was not a legal element of a capture set.
The root cause was that we forced some definitions already in parser, which can lead to confusion when compiling the
standard library itself. We now refrain from doing that and build the references to these annotations as untyped
trees all the way down.

[Cherry-picked 7bf957d]
Base automatically changed from release-3.8.0_backport-24704 to release-3.8.0_backport-24273 December 21, 2025 17:21
@WojciechMazur WojciechMazur force-pushed the release-3.8.0_backport-24273 branch from 88d4b7d to c0e4701 Compare December 21, 2025 17:33
@WojciechMazur WojciechMazur force-pushed the release-3.8.0_backport-24709 branch from e7cb876 to 0d48002 Compare December 21, 2025 17:36
…s with unresolved `org.scala-lang/scala-reflect/3.8.0-RC3-bin-SNAPSHOT` (no such problem on main)
Dependencies.compilerInterface,
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13),
("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13).excludeAll(("org.scala-lang" % "scala-reflect")),
Copy link
Contributor Author

@WojciechMazur WojciechMazur Dec 21, 2025

Choose a reason for hiding this comment

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

This was no needed on main, FYI @hamzaremmal
It's mostly due to version of artifacts we're using:
For 3.8.0-RCs: scalaVersion := referenceVersion,
For main : scalaVersion := dottyNonBootstrappedVersion
Change introduced in 1ea06a4 not backported as it didn't seem to be crucial

Required to workaround:

[error] (scala3-compiler-bootstrapped-new / update) sbt.librarymanagement.ResolveException: Error downloading org.scala-lang:scala-reflect:3.8.0-RC3-bin-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: /Users/wmazur/.ivy2/local/org.scala-lang/scala-reflect/3.8.0-RC3-bin-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/scala-lang/scala-reflect/3.8.0-RC3-bin-SNAPSHOT/scala-reflect-3.8.0-RC3-bin-SNAPSHOT.pom
[error]   not found: https://repo.scala-lang.org/artifactory/fat-jar/org/scala-lang/scala-reflect/3.8.0-RC3-bin-SNAPSHOT/scala-reflect-3.8.0-RC3-bin-SNAPSHOT.pom
[error] Total time: 4 s, completed Dec 21, 2025, 7:04:16 PM

Base automatically changed from release-3.8.0_backport-24273 to release-3.8.0 December 22, 2025 10:52
@WojciechMazur WojciechMazur requested a review from a team as a code owner December 22, 2025 10:52
@WojciechMazur WojciechMazur merged commit 4e8dbfd into release-3.8.0 Dec 22, 2025
49 checks passed
@WojciechMazur WojciechMazur deleted the release-3.8.0_backport-24709 branch December 22, 2025 10:54
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.

4 participants