Skip to content

Commit 921f8bf

Browse files
authored
Merge pull request #2087 from dotty-staging/fix/ParSetLike
Fix compilation of ParSetLike by itself
2 parents b319440 + 8997bf1 commit 921f8bf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

compiler/src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ object Checking {
357357
*/
358358
def checkNoPrivateLeaks(sym: Symbol, pos: Position)(implicit ctx: Context): Type = {
359359
class NotPrivate extends TypeMap {
360-
var errors: List[String] = Nil
360+
var errors: List[() => String] = Nil
361361

362362
def accessBoundary(sym: Symbol): Symbol =
363363
if (sym.is(Private) || !sym.owner.isClass) sym.owner
@@ -384,7 +384,7 @@ object Checking {
384384
var tp1 =
385385
if (isLeaked(tp.symbol)) {
386386
errors =
387-
em"non-private $sym refers to private ${tp.symbol}\n in its type signature ${sym.info}" :: errors
387+
(() => em"non-private $sym refers to private ${tp.symbol}\n in its type signature ${sym.info}") :: errors
388388
tp
389389
}
390390
else mapOver(tp)
@@ -408,7 +408,7 @@ object Checking {
408408
}
409409
val notPrivate = new NotPrivate
410410
val info = notPrivate(sym.info)
411-
notPrivate.errors.foreach(ctx.errorOrMigrationWarning(_, pos))
411+
notPrivate.errors.foreach(error => ctx.errorOrMigrationWarning(error(), pos))
412412
info
413413
}
414414

compiler/test/dotc/tests.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class tests extends CompilerTest {
224224
|../scala-scala/src/library/scala/collection/SeqLike.scala
225225
|../scala-scala/src/library/scala/collection/generic/GenSeqFactory.scala""".stripMargin)
226226
@Test def compileIndexedSeq = compileLine("../scala-scala/src/library/scala/collection/immutable/IndexedSeq.scala")
227+
@Test def compileParSetLike = compileLine("../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala")
227228

228229
@Test def dotty = {
229230
dottyBootedLib

0 commit comments

Comments
 (0)