5 ms·
Is there return type polymorphism in Swift? Without it monad-generic operations are limited.
by IsTom 12y ago
Is there return type polymorphism in Swift? Without it monad-generic operations are limited.
- josephlord 12y agoYes. func f()->Bool { return true } func f()->Int { return 5 } let i:Int = f() let b:Bool = f() println(i) // Prints 5 println(b) // Prints true // This would be compile error as ambiguous //println(f())