Skip to content
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

Fix #13495: Break completion cycles #13596

Merged
merged 1 commit into from Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Expand Up @@ -1605,10 +1605,10 @@ object SymDenotations {
// children that are defined in the same file as their parents.
def maybeChild(sym: Symbol) =
(sym.isClass && !this.is(JavaDefined) || sym.originDenotation.is(EnumVal))
&& !owner.is(Package)
&& (!owner.is(Package)
|| sym.originDenotation.infoOrCompleter.match
case _: SymbolLoaders.SecondCompleter => sym.associatedFile == this.symbol.associatedFile
case _ => false
case _ => false)

if owner.isClass then
for c <- owner.info.decls.toList if maybeChild(c) do
Expand Down
20 changes: 20 additions & 0 deletions tests/pos/13495.scala
@@ -0,0 +1,20 @@
import scala.annotation.showAsInfix

object Test {
trait Component
sealed trait Deleted extends Component

type Deletable[L <: CList] <: CList = L match {
case h &: t => (h | Deleted) &: Deletable[t]
case CNil => CNil
}

sealed trait CList
sealed trait CNil extends CList
@showAsInfix case class &:[+C <: Component, +L <: CList](h: C, t: L) extends CList

case class A(x: Int, y: Int) extends Component
case class B(x: Int, y: Int) extends Component

val x: Deletable[A &: B &: CNil] = ???
}