diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/AsmUtil.java b/compiler/backend/src/org/jetbrains/jet/codegen/AsmUtil.java index 9f4ad62fbbf..f964f1ccce8 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/AsmUtil.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/AsmUtil.java @@ -491,7 +491,7 @@ public class AsmUtil { if (type == null || isNullableType(type)) continue; 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) { v.load(index, asmType); v.visitLdcInsn(parameter.getName().asString()); diff --git a/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.java b/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.java index deda44cb68f..147b5f5f921 100644 --- a/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.java +++ b/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.java @@ -2,13 +2,13 @@ package test; import org.jetbrains.annotations.NotNull; -public abstract class doGenerateParamAssertions { +public abstract class doGenerateParamAssertions { - 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 { - a.bar(null); + a.doTest(null); } catch (IllegalArgumentException e) { return; } diff --git a/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.kt b/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.kt index f887a801ddb..48ec8525c4b 100644 --- a/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.kt +++ b/compiler/testData/codegen/notNullAssertions/doGenerateParamAssertions.kt @@ -1,8 +1,14 @@ import test.doGenerateParamAssertions as C -class A : C() { - override fun bar(s: String) { - } +class TestString : C() { + override fun doTest(s: String) { } } -fun doTest() = C.foo(A()) +class TestUnit : C() { + override fun doTest(s: Unit) { } +} + +fun doTest() { + C.runTest(TestString()) + C.runTest(TestUnit()) +}