You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a type MyType or enum MyEnum, static methods on that type/enum should be callable using the Self type, rather than requiring the whole type be spelled. For example:
type MyType {
func staticFunc(): Int = 123
func method() {
// val num = MyType.staticFunc()
val num = Self.staticFunc() // <- do this instead
println(num)
}
}
This has a couple of implications.
Self is effectively keyworded, like self
Selfis not a valid type identifier anymore
Self cannot be used outside of a method
The text was updated successfully, but these errors were encountered:
Given a type
MyType
or enumMyEnum
, static methods on that type/enum should be callable using theSelf
type, rather than requiring the whole type be spelled. For example:This has a couple of implications.
Self
is effectively keyworded, likeself
Self
is not a valid type identifier anymoreSelf
cannot be used outside of a methodThe text was updated successfully, but these errors were encountered: