diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/TypeRemapper.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/TypeRemapper.kt index a681eac0661..92498daea76 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/TypeRemapper.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/TypeRemapper.kt @@ -46,9 +46,10 @@ class TypeRemapper private constructor( } fun registerTypeParameter(name: String) { - assert(typeParametersMapping[name] == null) { - "Type parameter already registered $name" - } + //TODO: enable after KT-34656 proper fix +// assert(typeParametersMapping[name] == null) { +// "Type parameter already registered $name" +// } typeParametersMapping[name] = TypeParameter(name, name, false, null) } diff --git a/compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt b/compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt new file mode 100644 index 00000000000..9e6aa1d1bd1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt @@ -0,0 +1,21 @@ +// FILE: 1.kt +package test + +interface Foo { + fun call(): String +} + +inline fun f(crossinline g: () -> String) = object: Foo { + fun foo() = g() + fun bar() = "K" + override fun call(): String = foo() + bar() +} + +// FILE: 2.kt +import test.* + +val x = f { "O" } + +fun box() : String { + return x.call() +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index a088d0042b2..da07ed70afc 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -211,6 +211,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/anonymousObject/kt19723.kt"); } + @TestMetadata("kt34656.kt") + public void testKt34656() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt"); + } + @TestMetadata("kt6552.kt") public void testKt6552() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt6552.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index d6f8f29a1bc..a4d769d538d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -211,6 +211,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/anonymousObject/kt19723.kt"); } + @TestMetadata("kt34656.kt") + public void testKt34656() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt"); + } + @TestMetadata("kt6552.kt") public void testKt6552() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt6552.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 31fccf27e29..8bb52efc1ba 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -211,6 +211,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/anonymousObject/kt19723.kt"); } + @TestMetadata("kt34656.kt") + public void testKt34656() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt"); + } + @TestMetadata("kt6552.kt") public void testKt6552() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt6552.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index 0c8aab8ba8c..6a215d2143c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -211,6 +211,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTest("compiler/testData/codegen/boxInline/anonymousObject/kt19723.kt"); } + @TestMetadata("kt34656.kt") + public void testKt34656() throws Exception { + runTest("compiler/testData/codegen/boxInline/anonymousObject/kt34656.kt"); + } + @TestMetadata("kt6552.kt") public void testKt6552() throws Exception { runTest("compiler/testData/codegen/boxInline/anonymousObject/kt6552.kt");