[swift-evolution] RFC: didset and willset

Chris Lattner clattner at apple.com
Fri May 20 12:41:23 CDT 2016


On May 20, 2016, at 7:26 AM, Matthew Johnson <matthew at anandabits.com> wrote:
>> (For instance, a perhaps controversial opinion: I think `dynamicType` is properly capitalized for the syntactic slot it's in. That's not to say I think we should *keep* `dynamicType`, but simply that `foo.dynamicType` is more appropriate than `foo.dynamictype` would be.)
> 
> +1.  'foo.dynamictype' seems strange to me. 

foo.dynamicType is broken for other reasons.  I see x.dynamicType as being a named operator (like sizeof) and not a property.  For example, we don’t want .dynamicType to show up in code completion on every value in the universe ("4.dynamicType”, really?).

That argues that it should be spelled as dynamicType(x), and ideally being a standard library feature instead of a keyword.

-Chris


More information about the swift-evolution mailing list