Is there a style guide or convention for how to declare an infix function?
I wonder what is the officially recommended way, or what is the most used way.
1
infix fun Class.test(something: Something): Class = this.test(something)
2
infix fun Class.test(something: Something): Class = test(something)
3
infix fun Class.test(something: Something): Class { return this.test(something) }
4
infix fun Class.test(something: Something): Class { return test(something) }
None of those options have anything specific to do with the use of infix but are general variations on ways to write the body of an extension function (or a non-extension member function).
Is there a style guide or convention for how to declare an infix function? I wonder what is the officially recommended way, or what is the most used way.
1
2
3
4