[swift-evolution] [Proposal draft] Remove objc requirement for optional protocol methods/properties
David Scrève
david.screve at dlta-studio.com
Mon Jan 11 14:24:28 CST 2016
> Le 11 janv. 2016 à 18:20, Douglas Gregor <dgregor at apple.com> a écrit :
>
>>
>> var loadPerson:(() -> Person)? {
>> return { return Person(name: "Scrève", surname: "David")}
>> }
>> }
>>
>> Double returns is quite complex to write and understand..but I agree this problem can be solved like this.
>
> Right. One could extend the language with a rule that allows a method to satisfy a read-only property requirement when that property is of (possibly optional) function type.
Yes, this could be a really good solution…Should I post a proposal for that ?
>>
>> And the compiler generates the code with the double return and property.
>>
>> What do you think about this ?
>
> Per my first comment about about satisfying a read-only property of function type with a method, I don’t think we need a special syntax at all to make it easy to conform to these protocols.
I agree :-)
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160111/de31155d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4233 bytes
Desc: not available
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160111/de31155d/attachment.p7s>
More information about the swift-evolution
mailing list