I often use read-only calculated properties, like this:
var sizeInBytes = 0 val sizeInBits get() = sizeInBytes * 8
The problem is that I often accidentally omit
get() = and get this instead:
var sizeInBytes = 0 val sizeInBits = sizeInBytes * 8
It compiles without a single warning and what I get is a simple constant read-only property. Testing catches this, naturally, and it’s not that big of a problem, but it’s still somewhat annoying.
I’m not sure whether it’s possible to fix it without too much effort. One idea is to forbid placing getter on the same line, like when both initializer and getter are present. But it will waste some vertical space and force a lot of people to reformat a lot of existing code, so it’s far from a perfect solution.