diff --git a/tests/pos-custom-args/captures/i24456.scala b/tests/pos-custom-args/captures/i24456.scala new file mode 100644 index 000000000000..e70145325113 --- /dev/null +++ b/tests/pos-custom-args/captures/i24456.scala @@ -0,0 +1,14 @@ +// Similar to i24207 + +class Generator: + private def generateTable(table: Table) = + val (ownRelations, unusedTerm) = calculateOwnRelations(table) + None + + private def calculateOwnRelations(table: Table) = + val ownRelations = table.relations.filter(_.association.isDefined) + (ownRelations, Nil) + +case class Table(relations: Seq[TableRelation]) +case class TableRelation(association: Option[Association]) +trait Association \ No newline at end of file diff --git a/tests/pos/i24456.scala b/tests/pos/i24456.scala new file mode 100644 index 000000000000..e70145325113 --- /dev/null +++ b/tests/pos/i24456.scala @@ -0,0 +1,14 @@ +// Similar to i24207 + +class Generator: + private def generateTable(table: Table) = + val (ownRelations, unusedTerm) = calculateOwnRelations(table) + None + + private def calculateOwnRelations(table: Table) = + val ownRelations = table.relations.filter(_.association.isDefined) + (ownRelations, Nil) + +case class Table(relations: Seq[TableRelation]) +case class TableRelation(association: Option[Association]) +trait Association \ No newline at end of file