ExperimentalCollectionLiteralsApi

This annotation marks the experimental API supporting collection literals in companion blocks of Kotlin standard collections.

Note that in order to use collection literals for Kotlin standard collections with new experimental operator fun of functions in collection companion blocks, you need to enable the corresponding experimental features by specifying the compiler arguments -Xcollection-literals and -Xcompanion-blocks.

Enabling -Xcollection-literals automatically opts in to this experimental API. Otherwise, any usage of a declaration annotated with @ExperimentalCollectionLiteralsApi must be accepted either by annotating that usage with the OptIn annotation, e.g. @OptIn(ExperimentalCollectionLiteralsApi::class), or by using the compiler argument -opt-in=kotlin.ExperimentalCollectionLiteralsApi.

Since Kotlin

2.5