From b0a706242fda030283471dff90b67bf9c6d2f6be Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 4 Dec 2025 01:09:09 +0100 Subject: [PATCH] chore: add regression test for #13889 --- tests/pos/i13889.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/pos/i13889.scala diff --git a/tests/pos/i13889.scala b/tests/pos/i13889.scala new file mode 100644 index 000000000000..68cb314a3104 --- /dev/null +++ b/tests/pos/i13889.scala @@ -0,0 +1,17 @@ +class DiscordRecord(fields: Map[String, Any]) extends Selectable { + def selectDynamic(name: String): Any = fields(name) +} + +type IdentifyScope = DiscordRecord { + val username: String +} + +type IncludeIf[Stated <: String, Requirement <: String, IfMatch] = Seq[Stated] match { + case Seq[Requirement] => IfMatch + case _ => Any +} + +type RawUser[Scopes <: String] = DiscordRecord & IncludeIf[Scopes, "identify", IdentifyScope] + +val obj: RawUser["identify"] = ??? +val _ = obj.username