Is that bad? We already have conditional inheritance in classes:
class Foo<T where _constraint_> : Bar<T> {}
If you move the where clause to the right:
class Foo<T> : Bar<T where _constraint_> {}
And drop the generic arguments:
class Foo : Bar where _constraint_ {}
The only difference is “protocol” vs “class”.
- Dave Sweeris
> On Apr 25, 2016, at 10:41 PM, Dmitri Gribenko via swift-evolution
> <[email protected]> wrote:
>
> On Mon, Apr 25, 2016 at 8:28 PM, Douglas Gregor via swift-evolution
> <[email protected]> wrote:
>> Did you consider an alternate syntax that puts the where clause outside the
>> braces, e.g.,
>>
>> protocol R : Q where AssocType : P {
>> // …
>> }
>
> To me this reads like declaring a conditional conformance.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <[email protected]>*/
> _______________________________________________
> 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