Kotlin Create Cancellation Scope

Hi guys,

Maybe a stupid question, I try to create a cancellation scope in Kotlin and I cannot ged rid of the error:

Overload resolution ambiguity. All these functions match.
public open fun newCancellationScope(proc: Functions.Proc1<CancellationScope!>!): CancellationScope! defined in io.temporal.workflow.Workflow
public open fun newCancellationScope(runnable: Runnable!): CancellationScope! defined in io.temporal.workflow.Workflow> Blockquote

So, how can I create a CancellationScope in Kotlin? Do you have any examples how to create it?

You could create a Runnable and pass it as param to Workflow.newCancellationScope, for example:

val runnable = Runnable {
  Async.function(activity::execActivity)
  // ...
}

val c = Workflow.newCancellationScope(runnable)
c.run()
// ...

thank you!