Skip to content

Document compatability with @PublishedApi internal declarations, and those used in in-module inline functions #546

@rnett

Description

@rnett

The docs state:

Declare atomic variables as private val or internal val. You can use just (public) val, but make sure they are not directly accessed outside of your Kotlin module (outside of the source set). Access to the atomic variable itself shall be encapsulated.

It would be nice to have it explicitly stated whether this includes @PublishedApi internal declarations, and whether the answer changes if the declaration is only used by in-module inline functions.

My understanding is that it's OK to use as long as it's only used via in-module inline functions, because the inlining inlines the processed IR, which has had the transformations applied. But it would be nice to confirm that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions