IntentionallyDefaultFacadeName

@Target(allowedTargets = [AnnotationTarget.FILE])
annotation class IntentionallyDefaultFacadeName(val reason: ExemptionReason = ExemptionReason.OTHER, val description: String = "")(source)

Acknowledges that the annotated file deliberately keeps the file facade class name derived from the file name.

The library-api-watchdog compiler plugin warns, in JVM compilations, about files whose public top-level functions or properties compile into a facade class without an explicit @file:JvmName: the derived name (foo.ktFooKt) leaks the file name into the Java API surface, and renaming the file - invisible to Kotlin callers - renames the facade and breaks Java users. Prefer choosing and pinning the facade name with @file:JvmName, and apply this annotation - as @file:IntentionallyDefaultFacadeName(...) - to suppress the warning when keeping the derived name is intended.

See the check documentation for rationale and examples.

Parameters

reason

why the derived facade name is intended.

description

free-form explanation of the exemption. May be empty only when reason explains the exemption on its own (ExemptionReason.FOR_BACKWARDS_COMPATIBILITY, ExemptionReason.API_DESIGN).

Properties

Link copied to clipboard
Link copied to clipboard