Hey guys!
I extracted this function and a call to it from page 143 into my playground, it’s almost exact except for the braces { } I added at the end of the function declaration.
func doAwesomeWork(on input: String,
using transformer: () -> Void,
then completion: () -> Void) {}
doAwesomeWork(on: "My Project") {
print("Doing work on \(input) in `transformer`")
} then: {
print("Finishing up in `completion`")
}
However the compiler throws the error Cannot find ‘input’ in scope for the function call when trying to interpolate the \(input) argument to the String within the first trailing closure.
I’m stuck trying to figure out why is this error happening, can someone help? Thanks!