I found a behaviour in Swift\'s type resolution that I don\'t fully understand. The following example compiles. My understanding is that:
method
im
You are misunderstanding what's happening. It's not about returning a value. Simplify, for a clearer demonstration of that:
func call8(_: UInt8) -> String { "8" }
func call16(_: UInt16) -> String { "16" }
func ƒ(_ call: (UInt8) -> String) { call(8) }
func ƒ(_ call: (UInt16) -> String) { call(16) }
ƒ(call8) // "8"
ƒ(call16) // "16"
Instead, it's all about multiple lines. Read all about it!
https://forums.swift.org/t/multiline-closure-is-not-inferring-the-return-type/40013
As for the fix, you've got to explicitly type, for disambiguation.