fix: Use a checked cast by reifying the generic type parameter
This commit is contained in:
parent
7aef6f3522
commit
5bc1c86f37
1 changed files with 1 additions and 1 deletions
|
|
@ -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].
|
* if the [Instruction] is not a [ReferenceInstruction] or the [Reference] is not of type [T].
|
||||||
* @see ReferenceInstruction
|
* @see ReferenceInstruction
|
||||||
*/
|
*/
|
||||||
fun <T : Reference> Instruction.getReference() = (this as? ReferenceInstruction)?.reference as? T
|
inline fun <reified T : Reference> Instruction.getReference() = (this as? ReferenceInstruction)?.reference as? T
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the index of the first [Instruction] that matches the predicate.
|
* Get the index of the first [Instruction] that matches the predicate.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue