Suffix/infix notation for properties


Any chance we can get a suffix/infix notation for member/extension properties? e.g.:

suffix val Int.seconds: Duration
    get() = Duration.ofSeconds(toLong())

So that instead of

val duration = 12.seconds

we can write

val duration = 12 seconds

and instead of

val duration = ((-12).seconds).abs()

we can write

val duration = -12 seconds abs()


We have no such plans. The parsing ambiguities seem to be scary.


Suffix notation has been deprecated in Scala because of the parsing ambiguities.


Yes, I guess I was wondering if the fact that it is a property and not a function means that the ambiguities are fewer/non-existent but it does not appear so. Thanks.