Compare commits
2 Commits
71a37a2906
...
180471e4cd
| Author | SHA1 | Date | |
|---|---|---|---|
| 180471e4cd | |||
| 9e11519608 |
@ -82,11 +82,14 @@ open class LynonDecoder(val bin: BitInput, val settings: LynonSettings = LynonSe
|
|||||||
if (it !is ObjClass)
|
if (it !is ObjClass)
|
||||||
scope.raiseClassCastError("Expected obj class but got ${it::class.simpleName}")
|
scope.raiseClassCastError("Expected obj class but got ${it::class.simpleName}")
|
||||||
it
|
it
|
||||||
} ?: scope.also {
|
} ?: run {
|
||||||
println("Class not found: $className")
|
val fallback = runCatching { scope.eval(className.value) }.getOrNull()
|
||||||
println("::: ${runCatching { scope.eval("Vault")}.getOrNull() }")
|
if (fallback != null) {
|
||||||
println("::2 [${className}]: ${scope.get(className.value)}")
|
println("Fallback to eval successful")
|
||||||
}.raiseSymbolNotFound("can't deserialize: not found type $className")
|
fallback as ObjClass
|
||||||
|
}
|
||||||
|
else scope.raiseSymbolNotFound("can't deserialize: not found type $className")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun decodeAnyList(scope: Scope, fixedSize: Int? = null): MutableList<Obj> {
|
suspend fun decodeAnyList(scope: Scope, fixedSize: Int? = null): MutableList<Obj> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user