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