Skip to content

Commit c13ecbd

Browse files
Fix #13495: break completion cycles
1 parent aaac006 commit c13ecbd

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

compiler/src/dotty/tools/dotc/core/SymDenotations.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -1605,10 +1605,10 @@ object SymDenotations {
16051605
// children that are defined in the same file as their parents.
16061606
def maybeChild(sym: Symbol) =
16071607
(sym.isClass && !this.is(JavaDefined) || sym.originDenotation.is(EnumVal))
1608-
&& !owner.is(Package)
1608+
&& (!owner.is(Package)
16091609
|| sym.originDenotation.infoOrCompleter.match
16101610
case _: SymbolLoaders.SecondCompleter => sym.associatedFile == this.symbol.associatedFile
1611-
case _ => false
1611+
case _ => false)
16121612

16131613
if owner.isClass then
16141614
for c <- owner.info.decls.toList if maybeChild(c) do

tests/pos/13495.scala

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import scala.annotation.showAsInfix
2+
3+
object Test {
4+
trait Component
5+
sealed trait Deleted extends Component
6+
7+
type Deletable[L <: CList] <: CList = L match {
8+
case h &: t => (h | Deleted) &: Deletable[t]
9+
case CNil => CNil
10+
}
11+
12+
sealed trait CList
13+
sealed trait CNil extends CList
14+
@showAsInfix case class &:[+C <: Component, +L <: CList](h: C, t: L) extends CList
15+
16+
case class A(x: Int, y: Int) extends Component
17+
case class B(x: Int, y: Int) extends Component
18+
19+
val x: Deletable[A &: B &: CNil] = ???
20+
}

0 commit comments

Comments
 (0)