[swift-dev] How is `static` a contextual keyword?
Jose Cheyo Jimenez
cheyo at masters3d.com
Thu May 11 17:48:34 CDT 2017
Hello Swift Dev,
`class` is a contextual keyword because it can be used to declare an object and declare a class variable. Right?
I believe static can only be used inside Classes, Structs, Enums, Protocols and Extensions so how is `static` a _contextual_ keyword?
Is there a reason why static is a keyword and not a “buildIn” modifier like final, public etc?
Or is it just for historic reasons?
“The "type" keyword was split into two: "static" and "class". One can define static functions and static properties in structs and enums like this:…."
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-dev