[swift-evolution] Should Swift apply "statement scope" for ARC

John Holdsworth mac at johnholdsworth.com
Sun Sep 25 05:19:33 CDT 2016

> On 25 Sep 2016, at 04:07, Michael Gottesman <mgottesman at apple.com> wrote:
>>     init(imageProducer:ImageProducer) {
>>         withExtendedLifetime(CanvasBase()) {
>>             super.init(javaObject: $0.javaObject)
>>         }
>>         image = createImage(imageProducer)
>>     }
>> ..but the compiler was having none of it.
> What was the error? I am assuming that super.init was not in the same function?

Sorry, I should have included that in the email. The error was:

error: initializer chaining ('super.init') cannot be nested in another expression

Is it possible to build in an exception for withExtendedLifetime?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160925/feab26d9/attachment.html>

More information about the swift-evolution mailing list