> On Apr 14, 2016, at 1:11 PM, Taras Zakharko <[email protected]> wrote: > > I do not understand why we can’t do > > type(self) > > or even > > #type(self) > > Personally, I find .Self business to be quite confusing and idiosyncratic. > Having a generic #type() directive would be a general improvement for the > language design and it would also open up future possibilities such as > > extension A where A.B == #type(A.C.property1) { > > } > > and other potentially useful things.
Swift's type system has static and dynamic manifestations, and you're conflating them here. #type in a situation like `where A.B == #type(A.C.property1)` would have to produce the static type of property, whereas `x.dynamicType` today produces the dynamic type of a class or existential. -Joe _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
