On Thu, Oct 19, 2017 at 08:59 Mike Kluev <mike.kl...@gmail.com> wrote:

> On 19 October 2017 at 08:52, Xiaodi Wu <xiaodi...@gmail.com> wrote:
>
>> No, I'm talking about the implicit discardability proposed by Brent, such
>> as for all Optional<@discardable T>.
>>
>> He proposes that the @discardable syntax has a strong motivating
>> advantage because it can be extended in a way to mark _types_ so that
>> return values of those types are always implicitly @discardable. That is:
>>
>> @discardable class A { ... }
>> // any return value of type A is implicitly discardable
>> // what happens if A : Error and I throw A?
>>
>> class B : A { ... }
>> // is any return value of type B also implicitly discardable?
>
>
> "discardable" only apply to return types, similar to how "inout" only
> applies to "parameter types"
> (e.g. you can't make "func foo(x: Optional<inout Bool>)"
>

Of course. That’s not the concern.
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to