Skip to content

Commit 234fc4e

Browse files
committed
Hotfix4: Fixed Dynamic invocation auto-casting.
1 parent a422d31 commit 234fc4e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ buildscript {
1818
}
1919

2020
group 'com.github.jonathanxd'
21-
version '3.0.3-hotfix3'
21+
version '3.0.3-hotfix4'
2222

2323
apply from: project(":CodeAPI").file("gradle/common.gradle")
2424

src/main/kotlin/com/github/jonathanxd/codeapi/bytecode/gen/visitor/ArgumentHolderVisitor.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ package com.github.jonathanxd.codeapi.bytecode.gen.visitor
2929

3030
import com.github.jonathanxd.codeapi.CodeAPI
3131
import com.github.jonathanxd.codeapi.base.ArgumentHolder
32+
import com.github.jonathanxd.codeapi.base.MethodInvocation
3233
import com.github.jonathanxd.codeapi.bytecode.BytecodeClass
3334
import com.github.jonathanxd.codeapi.bytecode.common.MVData
3435
import com.github.jonathanxd.codeapi.bytecode.util.CodePartUtil
@@ -45,6 +46,11 @@ object ArgumentHolderVisitor : VoidVisitor<ArgumentHolder, BytecodeClass, MVData
4546
val types = t.types
4647
// Try to auto box and unbox
4748
val arguments = t.arguments.mapIndexed { i, it ->
49+
50+
// Auto boxing and unboxing disabled for dynamic invocations (like lambdas)
51+
if(it is MethodInvocation && it.invokeDynamic != null)
52+
return@mapIndexed it
53+
4854
val type = CodePartUtil.getTypeOrNull(it)
4955
val argType = types[i]
5056

0 commit comments

Comments
 (0)