[console] Fixed reaching UNREACHABLE_CLAUSE when running extensions with non-null function results. (#2528)

This commit is contained in:
NoMathExpectation 2023-02-24 10:15:43 +08:00 committed by GitHub
parent 48d674b383
commit a6afd9540c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,8 +147,8 @@ public inline fun <T, R> InterceptResult<T>.fold(
callsInPlace(onIntercepted, InvocationKind.AT_MOST_ONCE)
callsInPlace(otherwise, InvocationKind.AT_MOST_ONCE)
}
value?.let(otherwise)
reason?.let(onIntercepted)
value?.let { return otherwise(it) }
reason?.let { return onIntercepted(it) }
UNREACHABLE_CLAUSE
}