W3cubDocs

/Kotlin

callsInPlace

Platform and version requirements: JVM (1.0), JS (1.0), Native (1.0)
abstract fun <R> callsInPlace(
    lambda: Function<R>, 
    kind: InvocationKind = InvocationKind.UNKNOWN
): CallsInPlace

Specifies that the function parameter lambda is invoked in place.

This contract specifies that:

  1. the function lambda can only be invoked during the call of the owner function, and it won't be invoked after that owner function call is completed;
  2. (optionally) the function lambda is invoked the amount of times specified by the kind parameter, see the InvocationKind enum for possible values.

A function declaring the callsInPlace effect must be inline.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.contracts/-contract-builder/calls-in-place.html