[swift-evolution] Changing postfix "self" to something clearer like "type"

Joe Groff jgroff at apple.com
Thu Dec 17 11:50:11 CST 2015


> On Dec 17, 2015, at 9:44 AM, Jordan Rose via swift-evolution <swift-evolution at swift.org> wrote:
> 
> It's intended to be required all the time; the cases where it's not required are a bug. (I think it's just single-argument function calls, but I could be wrong.)
> 
> Again, it's intended to allow the compiler to produce better diagnostics for "let x = SomeType" when you really meant "let x: SomeType". I can't think of any other examples where the error messages wouldn't be obvious, but with a declaration the diagnostics may be somewhere unrelated to the issue. (Especially if it's a property.)

There's also a syntactic ambiguity with < > being both operators and generic parameter brackets that we resolve by requiring generic parameters in expression context to always be followed by a paren, as in a construction Foo<Bar>(), or by a dot, as in Foo<Bar>.member. C# does the same.

-Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151217/5d6a900a/attachment.html>


More information about the swift-evolution mailing list