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:…."
https://github.com/apple/swift/commit/571c9b3c5ef995e280b494c751804b385b49e7b9
<https://github.com/apple/swift/commit/571c9b3c5ef995e280b494c751804b385b49e7b9>
Thanks!
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev