https://kotlinlang.org logo
Title
n

Natalia Peterwas

04/25/2023, 3:16 PM
Hey I wonder about arity of the kotlin docs block types? https://kotlinlang.org/docs/kotlin-doc.html#see-identifier This is what I have deducted. Is this correct? can you help me fill the gaps? @param name - many @return - one @constructor - one @receiver - many @property name - many @throws class - many @exception class - ? @sample identifier - many @see identifier - many @author - one @since - one @suppress - one What is a difference between @throws class and @exception class?
c

CLOVIS

04/25/2023, 3:29 PM
@throws
and
@exception
is the same thing as far as I know
I didn't know about
@receiver
, thanks for the info
I think
@receiver
is "one", not "many". Apart from that, your list looks good to me
a

Ayfri

04/25/2023, 4:19 PM
Maybe it's many because of the context receivers ?
c

CLOVIS

04/25/2023, 4:22 PM
They're not a thing yet, and I doubt the prototype is fleshed out enough to bother with stuff like this
c

Casey Brooks

04/25/2023, 7:52 PM
I’d be curious to know if context receivers would make the
@receiver
arity “many”, or if a new
@context
tag would be added. My gut tells me that the latter would make more sense and be closer to the intended understanding of context receivers, that they are a bit more nuanced that just “multiple receivers”. Also, it’s worth remembering that context receivers has been deferred until after the K2 migration is complete. I believe the roadmap for it will be: 1.9 (final release without stable K2), 2.0 (first release with stable K2), 2.1 (with full context receiver support). So we’ve got a while until this feature becomes stable.
c

CLOVIS

04/25/2023, 10:55 PM
To my knowledge, they never stated explicitly that 2.1 will have full context receiver support. They said “after 2.0”. I wonder if 2.1 will be statics and collection literals, and 2.2 will be context receivers.
I'm personally hyped for neither so I think it's a shame that they're prioritized, but oh well.
n

Natalia Peterwas

04/26/2023, 8:58 AM
Upd: @param name - many @return - one @constructor - one @receiver - one @property name - many @throws class == @exception class - many @sample identifier - many @see identifier - many @author - one? @since - one @suppress - one
Thanks for the answers. I agree that @receiver should be one. But I’m starting to wonder about @author. I think it makes sense that it should be one, but IntelliJ IDEA allows me to write several authors.
c

CLOVIS

04/26/2023, 9:03 AM
I've never really seen
author
be used, honestly. Everyone uses Git, which is just better at storing that info.