Join Slack
Powered by
Is there a way to create static extension function...
# announcements
e
E.Kisaragi
11/20/2019, 3:17 AM
Is there a way to create static extension function to existing class?
x
Xavier F. Gouchet
11/20/2019, 5:48 AM
Out of curiosity, what would be the purpose of creating a static extension function?
t
trathschlag
11/20/2019, 9:03 AM
Doesn't pollute the autocompletion and works with classes not under your control
m
Mike
11/20/2019, 11:41 AM
Just remember that if the class isn't under your control, it has to have a Companion defined already, or this won't compile.
☝️ 1
Mike
11/20/2019, 11:41 AM
stdlib classes all do AFAIK.
🚫 2
m
Matteo Mirk
11/20/2019, 11:54 AM
👌
https://twitter.com/kotlin/status/1194655130576019456
6
Views
Open in Slack
Previous
Next