File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -509,9 +509,13 @@ class Namer { typer: Typer =>
509
509
def insertInto (annots : List [Annotation ]): List [Annotation ] =
510
510
annots.find(_.symbol == defn.ChildAnnot ) match {
511
511
case Some (Annotation .Child (other)) if childStart <= other.pos.start =>
512
- assert(childStart != other.pos.start, " duplicate child annotation $child / $other" )
513
- val (prefix, otherAnnot :: rest) = annots.span(_.symbol != defn.ChildAnnot )
514
- prefix ::: otherAnnot :: insertInto(rest)
512
+ if (child == other)
513
+ annots // can happen if a class has several inaccessible children
514
+ else {
515
+ assert(childStart != other.pos.start, i " duplicate child annotation $child / $other" )
516
+ val (prefix, otherAnnot :: rest) = annots.span(_.symbol != defn.ChildAnnot )
517
+ prefix ::: otherAnnot :: insertInto(rest)
518
+ }
515
519
case _ =>
516
520
Annotation .Child (child) :: annots
517
521
}
You can’t perform that action at this time.
0 commit comments