.self is a syntax salt. This is not necessary from a technical point of view, but it exists to cause errors in the code, which is often the result of a typo, for example:
struct Foo { } let foo = Foo
This code will give you a compiler error telling you that either you need to make an initialization / function / method call, or add .self if you want to refer to the type.
In the last example, the context refers exclusively to types, not values, so there is no way to knock them from another, so .self not required.
There may be a way to change the function declaration in your example so as not to require .self , but I don't know about such a function. I would be interested to know.
Alexander
source share