> 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 :)
Is unique meant so that User-Objects can't be used as "Object"-Object
parameters?
I'm asking because this might be the biggest source of confusion with struct
inheritance:
As the two "child-structs" don't add new data to their parent, they would
(technically) be compatible — but this is fragile, so it might be preferable to
"hide" polymorphism by default, and maybe add an annotation to explicitly allow
that a sub-struct can be used as its parent type.
@compatible(Float) struct SpecialFloat: Float...
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution