You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
can you add sample to get return value of eval() ?
something like this:
val result : ResultWithDiagnostics<EvaluationResult> = eval(...)
result.castOrError<ResultWithDiagnostics.Success<EvaluationResult>> {
"script evaluation failed. $it"
}.value.returnValue.castOrError<ResultValue.Value> {
"script evaluation result is $it"
}.value.castOrError<AppConfig> { // your expected class for value
"script returns value, but it's not AppConfig. ${it?.javaClass?.simpleName}"
}.let { config = it }
inline fun <reified T:Any> Any?.castOrError(noinline messageCreator:(Any?)->String) =
(this as? T) ?: error(messageCreator(this))
The text was updated successfully, but these errors were encountered:
can you add sample to get return value of eval() ?
something like this:
The text was updated successfully, but these errors were encountered: