Is there any public API Kotlin annotation (like `[...
# announcements
c
Is there any public API Kotlin annotation (like
[PublicAPI]
attribute in JetBrains Annotations .NET library) that would mark a class/method/… as public API and therefore stop showing warnings
Property could be private
?
y
IIRC there's
@PublishedApi
c
@Youssef Shoaib [MOD] Yes, but it has a different usage.
It allows an internal class/member to be used from public inline functions.
y
Yes but I think it then also removes that warning. You can also use a
@Suppress
that can be auto-generated by the IDE
c
Suppress isn't really elegant to be honest, and you can't even use
@PublishedApi
on public members
m
I usually don’t suppress “Property could be private” and “Unused …” warnings. What they actually tell you is that you don’t have unit tests set up, hence they’re unused / could be private ;)
Otherwise, simply use
@Suppress
.