[minor] fixes after review
This commit is contained in:
@@ -167,5 +167,5 @@ fun <R> ResultWithDiagnostics<R>.resultOrNull(): R? = when (this) {
|
|||||||
*/
|
*/
|
||||||
inline fun <R> ResultWithDiagnostics<R>.resultOr(body: (ResultWithDiagnostics.Failure) -> Nothing): R = when (this) {
|
inline fun <R> ResultWithDiagnostics<R>.resultOr(body: (ResultWithDiagnostics.Failure) -> Nothing): R = when (this) {
|
||||||
is ResultWithDiagnostics.Success<R> -> value
|
is ResultWithDiagnostics.Success<R> -> value
|
||||||
else -> body(this as ResultWithDiagnostics.Failure)
|
is ResultWithDiagnostics.Failure -> body(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ package kotlin.script.experimental.api
|
|||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
const val REPL_SNIPPET_FIRST_NO = 1
|
const val REPL_SNIPPET_FIRST_NO = 1
|
||||||
const val REPL_Snippet_FIRST_GEN = 1
|
const val REPL_SNIPPET_FIRST_GEN = 1
|
||||||
|
|
||||||
interface ReplSnippetId : Serializable, Comparable<ReplSnippetId> {
|
interface ReplSnippetId : Serializable, Comparable<ReplSnippetId> {
|
||||||
val no: Int
|
val no: Int
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ interface KotlinJsr223InvocableScriptEngine : Invocable {
|
|||||||
sequenceOf(requestedReceiver) + backwardInstancesHistory.filterNot { it == requestedReceiver }
|
sequenceOf(requestedReceiver) + backwardInstancesHistory.filterNot { it == requestedReceiver }
|
||||||
|
|
||||||
override fun invokeFunction(name: String?, vararg args: Any?): Any? {
|
override fun invokeFunction(name: String?, vararg args: Any?): Any? {
|
||||||
if (name == null) throw java.lang.NullPointerException("function name cannot be null")
|
if (name == null) throw AssertionError("function name cannot be null")
|
||||||
return invokeImpl(backwardInstancesHistory, name, args)
|
return invokeImpl(backwardInstancesHistory, name, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user