The error is shown because 'b' and 'f' do have different signatures.
'b' is an escaping closure 'f' is not.
when doing:
let a = f
you are copying 'f'. The signature stays the same "nonescaping () -> ()".
Declaring a closure in function definition gives you implicit 'nonescaping' in body gives you implicit 'escaping'.
Decorating your closure in the header with @escaping will solve the problem.
func test(f: @escaping () -> ()) {
If you want to know more: https://medium.com/swiftcommmunity/what-do-mean-escaping-and-nonescaping-closures-in-swift-d404d721f39d