[swift-evolution] Initialize associated Types

James Campbell james at supmenow.com
Thu Jan 7 10:58:40 CST 2016


Yeah I want a protocol (In this case Unit) expression that says if the
class implementing this protocol has an associated type which is a
SignedIntegerType and it is initialized with a SignedIntegerType.

Then it should set the property value (Which should be the same type as the
assosiated type) with that SignedIntegerType

On Thu, Jan 7, 2016 at 4:33 PM, Guillaume Lessard <
glessard at tffenterprises.com> wrote:

> You can do that if your constraining protocol defines an initializer with
> the desired signature.
> I tried with both a struct extension and a protocol extension, no problem.
>
> Is this about modifying the interface of SignedIntegerType, then?
>
> Guillaume Lessard
>
>


-- 
 Wizard
james at supmenow.com
+44 7523 279 698
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160107/50cc1ef7/attachment.html>


More information about the swift-evolution mailing list