From 1dc6c7c198ec12fd552f631392cf5921b1a9602f Mon Sep 17 00:00:00 2001 From: noti0na1 Date: Thu, 20 Nov 2025 13:58:48 +0100 Subject: [PATCH] Cleanup the info of a Bind symbol in posttyper [Cherry-picked c0abb058cc0443b27b44359c509327e2ac15bc00] --- tests/pos-custom-args/captures/i24456.scala | 14 ++++++++++++++ tests/pos/i24456.scala | 14 ++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 tests/pos-custom-args/captures/i24456.scala create mode 100644 tests/pos/i24456.scala 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