From f7a296e1f17d7bfb5fd303ee83cabd8d625781b9 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 18 Nov 2023 03:27:00 +0100 Subject: [PATCH] fix: Use a checked cast by reifying the generic type parameter --- src/main/kotlin/app/revanced/extensions/Extensions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/extensions/Extensions.kt b/src/main/kotlin/app/revanced/extensions/Extensions.kt index 9add679d9..309dc5396 100644 --- a/src/main/kotlin/app/revanced/extensions/Extensions.kt +++ b/src/main/kotlin/app/revanced/extensions/Extensions.kt @@ -115,7 +115,7 @@ fun BytecodeContext.traverseClassHierarchy(targetClass: MutableClass, callback: * if the [Instruction] is not a [ReferenceInstruction] or the [Reference] is not of type [T]. * @see ReferenceInstruction */ -fun Instruction.getReference() = (this as? ReferenceInstruction)?.reference as? T +inline fun Instruction.getReference() = (this as? ReferenceInstruction)?.reference as? T /** * Get the index of the first [Instruction] that matches the predicate.