runWithCancellationToken

abstract fun <T> runWithCancellationToken(token: CancellationToken, cb: (checker: TypeChecker) -> T): T(source)

Depending on the operation performed, it may be appropriate to throw away the checker if the cancellation token is triggered. Typically, if it is used for error checking and the operation is cancelled, then it should be discarded, otherwise it is safe to keep.