Add @noescape to output parameter of 'UnicodeCodecType.encode'


#1

Currently, all callers of this method in the Standard Library
assume `output` parameter has @noescape semantics.
So, I think, we can/should mark it with @noescape.
Is there a reason why it isn't?

public protocol UnicodeCodecType {

    // ...

    static func encode(
        input: UnicodeScalar,
        @noescape output: (CodeUnit) -> Void)
}

···

--
Rintaro Ishizaki


(Dmitri Gribenko) #2

Hi,

There is no reason, this function should be @noescape. A pull request
would be appreciated!

Dmitri

···

On Mon, Mar 7, 2016 at 11:21 PM, rintaro ishizaki via swift-evolution <swift-evolution@swift.org> wrote:

Currently, all callers of this method in the Standard Library
assume `output` parameter has @noescape semantics.
So, I think, we can/should mark it with @noescape.
Is there a reason why it isn't?

public protocol UnicodeCodecType {

    // ...

    static func encode(
        input: UnicodeScalar,
        @noescape output: (CodeUnit) -> Void)
}

--
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 <gribozavr@gmail.com>*/