> On May 31, 2016, at 8:45 PM, Adrian Zubarev via swift-evolution > <[email protected]> wrote: > > I feel like return is very important part of guard statement. I understand > the requirement for consistency with properties/closures/functions, but I’ll > prefer to have some inconsistency in language in this case and require return > for guard. And in case I’ll have to choose all-or-nothig, I’ll give –1 for > the proposal. > What’s the problem with single-expression guards? guard cannot fall trough > and the type is inferred as the same as its parent closure has. > > If we’d like to have this consistence everywhere in the language, guards will > be part of that as well. > > I’d interpret that as being able to write: > > var x: Int8 { 20 } > as opposed to: > var x: Int8 { Int8(20) } > Comment: > > Integer literals are untyped and pick up the type of their context. > > Joe Groff <https://twitter.com/jckarter/status/649275500506955780> > so there is no way to draw a parallel between integer literals and say ‘value’ ?
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
