Skip to content

Commit 3a93b3e

Browse files
authored
Merge pull request #2090 from dotty-staging/fix/ParSetLike
Fix #2089: Error when compiling ParSetLike, ParSet, SetLike, in this order
2 parents a832273 + bba147a commit 3a93b3e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,13 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
10801080
(if (isVarPattern(arg)) desugar.patternVar(arg) else arg, tparam.paramBounds)
10811081
else
10821082
(arg, WildcardType)
1083+
if (tpt1.symbol.isClass)
1084+
tparam match {
1085+
case tparam: Symbol =>
1086+
// This is needed to get the test `compileParSetSubset` to work
1087+
tparam.ensureCompleted()
1088+
case _ =>
1089+
}
10831090
typed(desugaredArg, argPt)
10841091
}
10851092
args.zipWithConserve(tparams)(typedArg(_, _)).asInstanceOf[List[Tree]]

compiler/test/dotc/tests.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ class tests extends CompilerTest {
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")
227227
@Test def compileParSetLike = compileLine("../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala")
228+
@Test def compileParSetSubset = compileLine(
229+
"""../scala-scala/src/library/scala/collection/parallel/mutable/ParSetLike.scala
230+
|../scala-scala/src/library/scala/collection/parallel/mutable/ParSet.scala
231+
|../scala-scala/src/library/scala/collection/mutable/SetLike.scala""".stripMargin)(scala2mode ++ defaultOptions)
228232

229233
@Test def dotty = {
230234
dottyBootedLib

0 commit comments

Comments
 (0)