Jorge Bo
03/18/2022, 7:50 PMTom Hermann
03/18/2022, 8:41 PMIn most cases, you define extensions on the top level, directly under packages:https://kotlinlang.org/docs/extensions.html#scope-of-extensions In the stdlib, it is pretty common to see a plural version of the extension receiver as the filename, like
Strings.kt
for extensions of the String
type. https://github.com/JetBrains/kotlin/blob/master/libraries/stdlib/src/kotlin/text/Strings.kt
Making private extension functions in a file can also be nice if you have something that isn’t general purpose and you just want to make something read a little cleaner in the context of a file.Landry Norris
03/20/2022, 9:03 PMJorge Bo
03/21/2022, 11:40 AM