> Le 13 oct. 2017 à 23:23, Mike Kluev via swift-evolution
> <[email protected]> a écrit :
>
> On 13 October 2017 at 21:15, Jean-Daniel <[email protected]
> <mailto:[email protected]>> wrote:
> I don’t think this is a good idea to make discardable part of the function
> type.
>
> What would fun(callback: () -> discardable Int) would means ?
>
> you mean this?
>
> func foo(callback: () -> discardable Int) {
> ...
> let x = callback()
> ...
> callback() // no warning or error here
> }
>
> Mike
>
I mean:
func foo() -> Int { … }
func bar(callback: () -> discardable Int) { … }
bar(foo) // does it warns ?
bar({ 3 }) // does it warns ? If it does, how to avoid it ?
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution