diff --git a/python/openapi/src/com/jetbrains/python/Result.kt b/python/openapi/src/com/jetbrains/python/Result.kt index cb5ec1db5953..809116ec6e66 100644 --- a/python/openapi/src/com/jetbrains/python/Result.kt +++ b/python/openapi/src/com/jetbrains/python/Result.kt @@ -221,3 +221,9 @@ val Result.isSuccess: Boolean get() = this is Success */ fun Result.getOrThrow(): S = orThrow() + +/** + * See [Result.mapSuccess] + */ +inline fun Iterable>.mapError(code: (E) -> E2): List> = + map { it.mapError(code) }