mbonnin
11/17/2023, 2:17 PMexplicitApi()
? I get the intent but feels like it duplicates tools like kotlin binary compatibilty validator or metalava. With kbcv, forgetting to add an internal
fails the build just like explicitApi()
would. Same for implicit return types (fun foo() = ...
)
And kbcv saves the ceremony of adding public
everywhere (in addition to actually tracking the API).
In its current state, the only win of explicitApi()
seems to be that it removes the "unused symbol" warning for potentially unused public API but even that feels borderline counterproductive given that tests should cover most of public API and worst case, it's possible to remove with @Suppress("unused")
.
Thoughts?Tijl
11/17/2023, 3:52 PMexplicitApi
. We don’t use the latter, though I feel if we would it might help people more easily understand why they broke the API when kbcv flags it.mbonnin
11/17/2023, 4:05 PMexplicitApi
has to offer. Also I'd argue not having several "flavours" of Kotlin is nice. i.e. I get the same visibility behaviour whether writing an app or libCLOVIS
11/20/2023, 8:54 AMpublic
everywhere. It feels like it's counter-productive to Kotlin's terseness.
If explicitApi
only meant "public declarations must have explicit type declarations", then I would use it.mbonnin
11/20/2023, 8:54 AMCLOVIS
11/20/2023, 8:55 AMpublic
everwherembonnin
11/20/2023, 8:55 AMmbonnin
11/20/2023, 8:55 AMmbonnin
11/20/2023, 8:56 AMexplicitApi()
= public API must have public
keywork in front of them + no return type inferred from an expressionCLOVIS
11/20/2023, 8:56 AMmbonnin
11/20/2023, 8:56 AMCLOVIS
11/20/2023, 8:58 AMmbonnin
11/20/2023, 8:59 AMCLOVIS
11/20/2023, 9:01 AM