An odd error: "Escaping closure captures mutating 'self'"

@tem I find the answer. I didn't read through SE-0035 carefully. It says the following (highlighting is added by me):

I propose we make it so that implicitly capturing an inout parameter into an escapable closure is an error.

Capturing an inout parameter, including self in a mutating method, becomes an error in an escapable closure literal, unless the capture is made explicit (and thereby immutable)

That explains it!

1 Like