Rename SuccessOrFailure to Result and hide Failure from ABI

* The members of Result are isSuccess, isFailure, exceptionOrNull, getOrNull
* The rest of API is implemented via inline-only extensions
* There are two internal functions to hide detailed mechanics of an internal
  Result.Failure class: createFailure and throwOnFailure
* Result.toString is explicit: either Success(v) or Failure(x)

See KT-26538
This commit is contained in:
Roman Elizarov
2018-09-09 11:34:31 +03:00
parent 69ee88871f
commit e2713501ce
81 changed files with 968 additions and 612 deletions
@@ -44,7 +44,6 @@ public class DescriptorUtils {
COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.child(Name.identifier("Continuation"));
public static final FqName CONTINUATION_INTERFACE_FQ_NAME_RELEASE =
COROUTINES_PACKAGE_FQ_NAME_RELEASE.child(Name.identifier("Continuation"));
public static final FqName SUCCESS_OR_FAILURE_FQ_NAME = new FqName("kotlin.SuccessOrFailure");
public static final FqName RESULT_FQ_NAME = new FqName("kotlin.Result");
// This JVM-specific class FQ name is declared here only because it's used in MainFunctionDetector which is in frontend