[swift-evolution] Epic: Typesafe calculations

Erica Sadun erica at ericasadun.com
Thu Jan 21 15:09:05 CST 2016

Going off the top of my head, I'd imagine it's a product type that inherits memory layout, code reuse, and conformances but introduces a distinct type for type safety checks. You could specialize the derived type with behavior and conformance that do not exist for the parent.

(It may also gain additional fields, I suppose, as well as super-type behavior calls, isKindOf checks, etc)

-- Erica

> On Jan 21, 2016, at 1:50 PM, David Waite via swift-evolution <swift-evolution at swift.org> wrote:
>> On Jan 21, 2016, at 1:22 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>> Yes, struct subtyping has come up several times.  There are several
>> things I'd like to do with it in the standard library.
> What do people mean when they say struct subclassing? Code reuse, polymorphism, or something else?
> -DW
> Sent with my Thumbs
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list