-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[chore] Set reference compiler version to 3.7.4-RC1 #24081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks like 3.7.4-RC1
is DOA.
Minimalization of the issue, we'll release an RC2 next week with fix for this issue - we'll revert the problematic PR
package scala package test import scala.language.`2.13` import language.experimental.captureChecking trait IterableOnce[+A] { this: IterableOnce[A]^ => def iterator: Iterator[A]^{this} } class SortedMap[K, +V] extends IterableOnce[(K, V)]: def iterator: Iterator[(K, V)]^{this} = ??? final class TreeMap[K, +V] object TreeMap: def fromOrderedEntries[A, B](xs: Iterator[(A, B)]): TreeMap[A, B] = ??? def from[K, V](it: IterableOnce[(K, V)]^): TreeMap[K, V] = it match case sm: SortedMap[K, V] => fromOrderedEntries(sm.iterator) ???
I will take a look
The errors look legit to me.
Take immutable.TreeSet.from
as an example, the parameter is tracked: it: IterableOnce[E]^
. After pattern match, ss
should be SortedSet[E]^{it}
. Calling iterator
will return an Interator^{ss}
, which is tracked as well. However, fromOrderedKeys
only accepts non-tracked Interator
, and causes error.
The correct fix would be updating fromOrderedKeys
and fromOrderedEntries
.
I don't understand why the errors were not caught during scala-library-bootstrapped
on nightly?
The errors should be solved after #24085
...24085) Fix errors in #24081 Take `immutable.TreeSet.from` as an example, the parameter is tracked: `it: IterableOnce[E]^`. After pattern match, `ss` should be `SortedSet[E]^{it}`. Calling `iterator` will return an `Interator^{ss}`, which is tracked as well. However, `fromOrderedKeys` only accepts non-tracked `Interator`, and causes error. The fix updates`fromOrderedKeys` and `fromOrderedEntries`.
c5af8de
to
e0f977c
Compare
Thank you @noti0na1 ! Seems like we don't need to hurry with RC2, @hamzaremmal non bootstrapped tests can be restored as soon as this PR is merged
No description provided.