Fix incorrect usage of mapReturnType in param assertions
This commit is contained in:
@@ -491,7 +491,7 @@ public class AsmUtil {
|
|||||||
if (type == null || isNullableType(type)) continue;
|
if (type == null || isNullableType(type)) continue;
|
||||||
|
|
||||||
int index = frameMap.getIndex(parameter);
|
int index = frameMap.getIndex(parameter);
|
||||||
Type asmType = state.getTypeMapper().mapReturnType(type);
|
Type asmType = state.getTypeMapper().mapType(type);
|
||||||
if (asmType.getSort() == Type.OBJECT || asmType.getSort() == Type.ARRAY) {
|
if (asmType.getSort() == Type.OBJECT || asmType.getSort() == Type.ARRAY) {
|
||||||
v.load(index, asmType);
|
v.load(index, asmType);
|
||||||
v.visitLdcInsn(parameter.getName().asString());
|
v.visitLdcInsn(parameter.getName().asString());
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ package test;
|
|||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public abstract class doGenerateParamAssertions {
|
public abstract class doGenerateParamAssertions<Type> {
|
||||||
|
|
||||||
public abstract void bar(@NotNull String s);
|
public abstract void doTest(@NotNull Type s);
|
||||||
|
|
||||||
public static void foo(doGenerateParamAssertions a) {
|
public static void runTest(doGenerateParamAssertions a) {
|
||||||
try {
|
try {
|
||||||
a.bar(null);
|
a.doTest(null);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
import test.doGenerateParamAssertions as C
|
import test.doGenerateParamAssertions as C
|
||||||
|
|
||||||
class A : C() {
|
class TestString : C<String>() {
|
||||||
override fun bar(s: String) {
|
override fun doTest(s: String) { }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun doTest() = C.foo(A())
|
class TestUnit : C<Unit>() {
|
||||||
|
override fun doTest(s: Unit) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
fun doTest() {
|
||||||
|
C.runTest(TestString())
|
||||||
|
C.runTest(TestUnit())
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user