Skip to content

Scope.optionalCapture

Dokka 2.2.0 generates this reference of the Kotlin spec builder during each site build from the Kotlin sources, and its summary lists every class and function. The guide shows the builder in use, the Java builder's reference covers the handles, types and expressions it shares, and the extensions read the data.

fun optionalCapture(type: IntType, name: String? = null): Capture<IntField<I?>>

A capture of an integer that may be absent, such as one in an optional arm.


fun optionalCapture(type: FloatType, name: String? = null): Capture<FloatField<F?>>

A capture of a float that may be absent.


fun optionalCapture(type: NumType, name: String? = null): Capture<NumField<N?>>

A capture of an integer or float that may be absent.


fun optionalCapture(type: StringType, name: String? = null): Capture<StringField<S?>>

A capture of a string that may be absent.