Since `set(value) = ...` for custom setters on var...
# codingconventions
c
Since
set(value) = ...
for custom setters on variable is also allowed, I'd say it's no problem.
Unit
is just a normal return type and value in Kotlin.
a
I know that it works, I'm asking whether the Kotlin Style Guide encourages to use expression body with a one-line Statement or not
c
it's indifferent on the matter. Common wisdom says, use them when they fit, don't when they don't, always specify return type in public API.
g
Our internal style guide suggests to always use body syntax for functions that return Unit
3
a
And thats why I'm wondering why people save 2 keystrokes (inside Intellij its one? additional keystrokes)
fun foo() = println("Hello World")
vs
fun foo()  { println("Hello world") }
just to be confused when
fun foo(customer) = updateCustomer(customer)
returns Unit when you expect some kind of Result
c
because it's not in the official guideline and they have yet to stumble upon a problem caused by this.