You refer to the example with two Self parameters, the only constraint the callee (i.e. ==
) adds to the context is that both parameters must be the same which is currently only unique for the same variable or different aliases to the same variable.
But ==
doesn't specify what Self
has to be for a type, that is specified by the caller, in our case it was specified by another callee with name Private
which was executed in the caller.
First I wouldn't call a value an existential, this is more kinded to a variable.
Second, we could also store the proofs of some P
inside the value of some P
and unwrap the existential behind, but why we should do so if there is the option to optimize the boxing of some P
out by simply replacing the box with the underlying type.
Yes, I see your point.
The Swift definition of existentials is more related to implementation details, my is more of abstract nature. So you are mostly correct with your conclusion.