<div dir="ltr">I think we're making incremental progress here. The idea of declaring a property which inherited from a given class and conformed to given protocols has definitely been discussed, but hasn't been reviewed (I don't know offhand whether it's scheduled or even formally written up). The idea of writing this for the declaration of the type itself might be new, I'm not sure.<div><br></div><div>I think SE-0095 - declaring multiple protocol conformances with '&' - was part of that progression, which might address some of your pitch, e.g. this example could be a bit clearer:</div><div>class Child: BaseClass, SomeProtocol1, SomeProtocol2</div><div>would now be</div><div>class Child: BaseClass, SomeProtocol1 & SomeProtocol2</div><div><br></div><div>Is some of this waiting on a fully thought out syntax for types including existentials?</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 22, 2016 at 2:14 PM, Vladimir.S via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I remember that this was discussed, but can't find any decision regarding this.. So, as a last chance, don't we want in Swift 3.0, as big source breaking change, separate class inheritance and protocol conformance in syntax?<br>
<br>
Sorry if there was a decision about this suggestions. Please let know in this case.<br>
<br>
I.e. when I see the following I can't understand if the class inherits from base class and conforms to protocols or just conforms to two protocols:<br>
<br>
class MyClass : First, Second, Third {<br>
}<br>
<br>
We don't have a rule to name protocols with 'Protocol'/other suffix/prefix, or classes with 'T'/'C' prefix or something like this, so I believe to improve the clarity of code we should separate in syntax inheritance and conformance.<br>
<br>
As I understand we should discuss changes in these areas:<br>
<br>
1. class inheritance :<br>
class Child: BaseClass<br>
<br>
2. class conformance :<br>
class Child: SomeProtocol1, SomeProtocol2<br>
<br>
3. class inheritance + conformance :<br>
class Child: BaseClass, SomeProtocol1, SomeProtocol2<br>
<br>
4. protocol conformance for structs:<br>
struct Struct: SomeProtocol1, SomeProtocol2<br>
<br>
5. protocol inheritance:<br>
protocol Child: BaseProtocol1, BaseProtocol2<br>
<br>
<br>
My suggestions:<br>
<br>
I) separate inheritance with double colon :<br>
<br>
1. class inheritance :<br>
class Child:: BaseClass<br>
<br>
2. class conformance :<br>
class Child: SomeProtocol1, SomeProtocol2<br>
<br>
3. class inheritance + conformance :<br>
class Child:: BaseClass : SomeProtocol1, SomeProtocol2<br>
<br>
4. protocol conformance for structs:<br>
struct Struct: SomeProtocol1, SomeProtocol2<br>
<br>
5. protocol inheritance:<br>
protocol Child:: BaseProtocol1, BaseProtocol2<br>
<br>
<br>
II) in class definition use parenthesis to separate inheritance and conformance :<br>
<br>
1. class inheritance :<br>
class Child: BaseClass<br>
<br>
2. class conformance :<br>
class Child: (SomeProtocol1, SomeProtocol2)<br>
<br>
3. class inheritance + conformance :<br>
class Child: BaseClass (SomeProtocol1, SomeProtocol2)<br>
<br>
4. protocol conformance for structs:<br>
struct Struct: SomeProtocol1, SomeProtocol2<br>
or<br>
struct Struct: (SomeProtocol1, SomeProtocol2)<br>
should be discussed<br>
<br>
5. protocol inheritance:<br>
protocol Child: BaseProtocol1, BaseProtocol2<br>
<br>
<br>
III) special word like 'conforms'<br>
<br>
1. class inheritance :<br>
class Child: BaseClass<br>
<br>
2. class conformance :<br>
class Child: conforms SomeProtocol1, SomeProtocol2<br>
or<br>
class Child conforms SomeProtocol1, SomeProtocol2<br>
<br>
3. class inheritance + conformance :<br>
class Child: BaseClass conforms SomeProtocol1, SomeProtocol2<br>
<br>
4. protocol conformance for structs:<br>
struct Struct: conforms SomeProtocol1, SomeProtocol2<br>
or<br>
struct Struct conforms SomeProtocol1, SomeProtocol2<br>
<br>
5. protocol inheritance:<br>
protocol Child: BaseProtocol1, BaseProtocol2<br>
<br>
<br>
Thoughts?<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div><br></div>