From 925f3df68c59e83bced6c1db8063e70482b0c603 Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Fri, 12 Aug 2022 02:49:04 +0800 Subject: [PATCH] Modify simplify code in HookParam --- .../kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt index 6ccbd1c8..72f7cbce 100644 --- a/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt +++ b/yukihookapi/src/api/kotlin/com/highcapable/yukihookapi/hook/param/HookParam.kt @@ -31,6 +31,7 @@ package com.highcapable.yukihookapi.hook.param import com.highcapable.yukihookapi.hook.core.YukiMemberHookCreater import com.highcapable.yukihookapi.hook.core.YukiMemberHookCreater.MemberHookCreater +import com.highcapable.yukihookapi.hook.factory.classOf import com.highcapable.yukihookapi.hook.log.yLoggerE import com.highcapable.yukihookapi.hook.param.wrapper.HookParamWrapper import java.lang.reflect.Constructor @@ -160,7 +161,7 @@ class HookParam internal constructor(private val createrInstance: YukiMemberHook * @return [T] * @throws IllegalStateException 如果对象为空或对象类型不是 [T] */ - inline fun instance() = instance as? T? ?: error("HookParam instance cannot cast to ${T::class.java.name}") + inline fun instance() = instance as? T? ?: error("HookParam instance cannot cast to ${classOf().name}") /** * 获取当前 Hook 对象的 [method] or [constructor] 的参数数组下标实例化类