Would love a way of extending an existing struct as a new type but it not
being related to the struct it extends.
Sort of like a mixin but for structs, so I could have:
struct Object {
let identifier: String
}
struct User: Object {
}
struct Tree: Object {
}
The last two structs get the identifier property "mixed" in but are unique
types :)
*___________________________________*
*James⎥Head Of CEO*
*[email protected] <[email protected]>⎥supmenow.com <http://supmenow.com>*
*Sup*
*Runway East *
*10 Finsbury Square*
*London*
* EC2A 1AF *
On Thu, Mar 24, 2016 at 2:16 PM, Tino Heth via swift-evolution <
[email protected]> wrote:
>
> > Could we accomplish something similar to `newtype` by making the
> `typealias` declaration more powerful?
> It's the first thing I tried, but afair someone from the Core Team opposed
> extending typealias - and I had to agree that an "alias" should be just a
> synonym.
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution