Hi Slava
Yes, I know all about variance, both co and contra 
We went through hell getting a grip on it around the time of C# 2, or should I say the then lack of it but, at least, Microsoft dealt with it and it seems to be better integrated.
I still think there is a major problem with "generic" protocols, which gives the lie to the statement found in the book "The Swift Programming Language"
Protocols as Types
Protocols don’t actually implement any functionality themselves. Nonetheless, any protocol you create will become a fully-fledged type for use in your code.
Because it’s a type, you can use a protocol in many places where other types are allowed, including:
- As a parameter type or return type in a function, method, or initializer
- As the type of a constant, variable, or property
- As the type of items in an array, dictionary, or other container
Note the wording any protocol you create will become a fully-fledged type for use in your code
This is simply not true. As soon as you violate the rules for Self or declare an associated type, you then have to waste hours writing boilerplate code for type erasure or finding another workaround.
In C#, protocols are simple to define and use:
interface IProperty
{
string name { get; set; }
}
IProperty<valueT> : IProperty
{
valueT value { get; set; }
}
IProperty can be used as the "type eraser" and there are no limitations on the parameter types that you can declare for the generic version. And there is no need to create yet another name like BaseProperty because, in C#, a generic type can have the same name as a non-generic type; they are regarded as two distinct types.
No, I am not saying that Swift should blindly copy C# but, at times, it does seem that Swift is trying to be different for the sake of being different, which is causing a lot of highly experienced developers to have to throw away years of coding experience and start again, just to satisfy a "fashion"