> Le 15 oct. 2017 à 15:52, Mike Kluev via swift-evolution > <swift-evolution@swift.org> a écrit : > > On 15 October 2017 at 14:23, Geordie Jay <geo...@gmail.com > <mailto:geo...@gmail.com>> wrote: > Hi Mike, > > 2017-10-15 14:55 GMT+02:00 Mike Kluev <mike.kl...@gmail.com > <mailto:mike.kl...@gmail.com>>: > On 15 October 2017 at 13:35, Geordie Jay <geo...@gmail.com > <mailto:geo...@gmail.com>> wrote: > Also we're not talking about whether the Bool itself is discardable. For > example, it makes no sense to write: > > let something: discardable Bool = true > > you can't write this either: > > let something: inout Bool = true > > that doesn't mean "inout" should be "@inputOutput" before the parameter name > in function signature. > > This is a different case: inout is an annotation on argument types (of which > there can be many). > > i mean: > > @discardableResult func foo(@inputOutput x: Int, @inputOutput y: Float) -> > Bool > > vs: > > func goo(x: inout Int, y: inout y) -> discardable Bool >
inout and discardableResult are fundamentally different. Inout change the calling convention and the way the parameter is passed. discardableResult is just an annotation to help catching bad function usage by warning the developer about it.
_______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution