Lifting the "Self or associated type" constraint on existentials

Yeah, it's my hope that that's eventually where we land with existentials. The handling of changing dynamic types can be seen as a flow-sensitive typing problem, similar to definite initialization—once you've formed a value that's dependent on the dynamic type of c, the type becomes fixed, so you wouldn't be allowed to reassign it to anything that wasn't of c.Self type after that point (or, alternatively, any types dependent on the original dynamic type could be invalid to use after you do so).

1 Like