restricted-marker-is-not-an-opt-in

Installation
SKILL.md

A restricted-to marker is not an opt-in

Two annotations in one library package, differing by a prefix, are enforced by completely different machinery. One is @RequiresOptIn: the compiler refuses the call until you acknowledge it. The other is @RestrictTo: the compiler does not care at all — it is a lint-visible statement that the API is internal to the library's own group.

Guessing between them produces two opposite mistakes: suppressions that do nothing, and a false sense that an API is public because it compiled.

Traps

Compiling without a suppression proves the marker is not an opt-in — nothing more. In this tree two such APIs are called with no acknowledgement at all, while a sibling file wraps two further calls to one of them in an @OptIn naming the similarly-spelled experimental marker — which acknowledges nothing, because that is not the marker either API carries. All of it ships, so the suppression is not what makes any of it compile; the file that has one is a live specimen of the trap below.

Installs
2
GitHub Stars
35
First Seen
6 days ago
restricted-marker-is-not-an-opt-in — maxrave-dev/kotlin-footguns