Out of curiosity, why is this forbidden? `class T...
# announcements
c
Out of curiosity, why is this forbidden?
Copy code
class Test(
  var test: Int,
    get = test++
    private set,
  val test2: Int
)
Is there any reason like a syntax ambiguity, or is it just because it's not ‘clean'?
d
s
I think they’re aware of the concept of backing fields… the question is about why declaring getters and setters can’t be made a bit less repetitive
I’d argue that the grammar for what OP is proposing is probably way too complex, not to mention I think it looks visually messy to even type lol
d
I agree @Shawn, I can't really picture so many real-world cases either