Skip to content

Commit e1baeb6

Browse files
anatoliykmetyuksmarter
authored andcommitted
Upgrade Dotty to 0.24.0-RC1
In that, avoid infix & varargs expansion in Console.printf: [error] 280 | def printf(text: String, args: Any*): Unit = { out.print(text format (args : _*)) } [error] | ^ [error] | `_*` can be used only for last argument of method application. [error] | It is no longer allowed in operands of infix operations. Also, avoid ambiguity errors after scala/scala3#8622
1 parent f7b74a7 commit e1baeb6

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

project/DottySupport.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import sbt.librarymanagement.{
1414
* Dotty in .travis.yml.
1515
*/
1616
object DottySupport {
17-
val dottyVersion = "0.23.0-RC1"
17+
val dottyVersion = "0.24.0-RC1"
1818
val compileWithDotty: Boolean =
1919
Option(System.getProperty("scala.build.compileWithDotty")).map(_.toBoolean).getOrElse(false)
2020
lazy val commonSettings = Seq(

src/library/scala/Console.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,5 @@ object Console extends AnsiColor {
277277
* @throws java.lang.IllegalArgumentException if there was a problem with the format string or arguments
278278
* @group console-output
279279
*/
280-
def printf(text: String, args: Any*): Unit = { out.print(text format (args : _*)) }
280+
def printf(text: String, args: Any*): Unit = { out.print(text.format(args: _*)) }
281281
}

src/library/scala/collection/Map.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ trait MapOps[K, +V, +CC[_, _] <: IterableOps[_, AnyConstr, _], +C]
158158
/** The implementation class of the set returned by `keySet`.
159159
*/
160160
protected class KeySet extends AbstractSet[K] with GenKeySet with DefaultSerializable {
161-
def diff(that: Set[K]): Set[K] = fromSpecific(view.filterNot(that))
161+
def diff(that: Set[K]): Set[K] = fromSpecific(this.view.filterNot(that))
162162
}
163163

164164
/** A generic trait that is reused by keyset implementations */

src/library/scala/collection/immutable/BitSet.scala

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,22 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
136136
protected[collection] def updateWord(idx: Int, w: Long): BitSet =
137137
if (idx == 0) new BitSet1(w)
138138
else if (idx == 1) createSmall(elems, w)
139-
else fromBitMaskNoCopy(updateArray(Array(elems), idx, w))
139+
else this.fromBitMaskNoCopy(updateArray(Array(elems), idx, w))
140140

141141

142142
override def diff(other: collection.Set[Int]): BitSet = other match {
143143
case bs: collection.BitSet => bs.nwords match {
144144
case 0 => this
145145
case _ =>
146146
val newElems = elems & ~bs.word(0)
147-
if (newElems == 0L) empty else new BitSet1(newElems)
147+
if (newElems == 0L) this.empty else new BitSet1(newElems)
148148
}
149149
case _ => super.diff(other)
150150
}
151151

152152
override def filterImpl(pred: Int => Boolean, isFlipped: Boolean): BitSet = {
153153
val _elems = BitSetOps.computeWordForFilter(pred, isFlipped, elems, 0)
154-
if (_elems == 0L) empty else new BitSet1(_elems)
154+
if (_elems == 0L) this.empty else new BitSet1(_elems)
155155
}
156156
}
157157

@@ -162,7 +162,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
162162
protected[collection] def updateWord(idx: Int, w: Long): BitSet =
163163
if (idx == 0) new BitSet2(w, elems1)
164164
else if (idx == 1) createSmall(elems0, w)
165-
else fromBitMaskNoCopy(updateArray(Array(elems0, elems1), idx, w))
165+
else this.fromBitMaskNoCopy(updateArray(Array(elems0, elems1), idx, w))
166166

167167

168168
override def diff(other: collection.Set[Int]): BitSet = other match {
@@ -176,7 +176,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
176176

177177
if (_elems1 == 0L) {
178178
if (_elems0 == 0L) {
179-
empty
179+
this.empty
180180
} else {
181181
new BitSet1(_elems0)
182182
}
@@ -193,7 +193,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
193193

194194
if (_elems1 == 0L) {
195195
if (_elems0 == 0L) {
196-
empty
196+
this.empty
197197
}
198198
else new BitSet1(_elems0)
199199
}
@@ -207,7 +207,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
207207

208208
protected[collection] def word(idx: Int) = if (idx < nwords) elems(idx) else 0L
209209

210-
protected[collection] def updateWord(idx: Int, w: Long): BitSet = fromBitMaskNoCopy(updateArray(elems, idx, w))
210+
protected[collection] def updateWord(idx: Int, w: Long): BitSet = this.fromBitMaskNoCopy(updateArray(elems, idx, w))
211211

212212
override def diff(that: collection.Set[Int]): BitSet = that match {
213213
case bs: collection.BitSet =>
@@ -245,7 +245,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
245245
}
246246
if (i < 0) {
247247
// all indices >= 0 have had result 0, so the bitset is empty
248-
empty
248+
this.empty
249249
} else {
250250
val minimumNonZeroIndex: Int = i + 1
251251
while (!anyChanges && i >= 0) {
@@ -256,7 +256,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
256256
}
257257
if (anyChanges) {
258258
if (minimumNonZeroIndex == -1) {
259-
empty
259+
this.empty
260260
} else if (minimumNonZeroIndex == 0) {
261261
new BitSet1(currentWord)
262262
} else if (minimumNonZeroIndex == 1) {
@@ -268,7 +268,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
268268
newArray(i) = word(i) & ~bs.word(i)
269269
i -= 1
270270
}
271-
fromBitMaskNoCopy(newArray)
271+
this.fromBitMaskNoCopy(newArray)
272272
}
273273
} else {
274274
this
@@ -291,7 +291,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
291291
newElems(i) = word(i) & ~bs.word(i)
292292
i -= 1
293293
}
294-
fromBitMaskNoCopy(newElems)
294+
this.fromBitMaskNoCopy(newElems)
295295
} else {
296296
this
297297
}
@@ -315,7 +315,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
315315
}
316316
if (i < 0) {
317317
// all indices >= 0 have had result 0, so the bitset is empty
318-
if (currentWord == 0) empty else fromBitMaskNoCopy(Array(currentWord))
318+
if (currentWord == 0) this.empty else this.fromBitMaskNoCopy(Array(currentWord))
319319
} else {
320320
val minimumNonZeroIndex: Int = i + 1
321321
while (!anyChanges && i >= 0) {
@@ -326,7 +326,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
326326
}
327327
if (anyChanges) {
328328
if (minimumNonZeroIndex == -1) {
329-
empty
329+
this.empty
330330
} else if (minimumNonZeroIndex == 0) {
331331
new BitSet1(currentWord)
332332
} else if (minimumNonZeroIndex == 1) {
@@ -338,7 +338,7 @@ object BitSet extends SpecificIterableFactory[Int, BitSet] {
338338
newArray(i) = BitSetOps.computeWordForFilter(pred, isFlipped, word(i), i)
339339
i -= 1
340340
}
341-
fromBitMaskNoCopy(newArray)
341+
this.fromBitMaskNoCopy(newArray)
342342
}
343343
} else {
344344
this

src/library/scala/collection/mutable/PriorityQueue.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ sealed class PriorityQueue[A](implicit val ord: Ordering[A])
6767
private class ResizableArrayAccess[A0] extends ArrayBuffer[A0] {
6868
override def mapInPlace(f: A0 => A0): this.type = {
6969
var i = 1 // see "we do not use array(0)" comment below (???)
70-
val siz = size
70+
val siz = this.size
7171
while (i < siz) { this(i) = f(this(i)); i += 1 }
7272
this
7373
}

0 commit comments

Comments
 (0)