[swift-evolution] Initialize associated Types

James Campbell james at supmenow.com
Thu Jan 7 04:22:09 CST 2016


I would love to be able to initilize another type like this:

extension Unit where Self.UnitType: SignedIntegerType  {

    init(_ value: Double) { //Ideally this could be generic too.

        self.init()

        self.value = Self.UnitType(value)

    }

}

-- 
 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/084e1502/attachment.html>


More information about the swift-evolution mailing list