From f6a6b55ffa93947faa9c9a6d690f02fcf18f410a Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Tue, 21 May 2013 13:14:28 +0400 Subject: [PATCH] Test for KT-3331 RuntimeException in frontend-java at TypeVariableResolverFromTypeDescriptors.getTypeVariable() #KT-3331 obsolete --- .../loadKotlin/class/InheritSubstitutedMethod.kt | 10 ++++++++++ .../loadKotlin/class/InheritSubstitutedMethod.txt | 12 ++++++++++++ .../compiler/LoadCompiledKotlinTestGenerated.java | 5 +++++ 3 files changed, 27 insertions(+) create mode 100644 compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt create mode 100644 compiler/testData/loadKotlin/class/InheritSubstitutedMethod.txt diff --git a/compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt b/compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt new file mode 100644 index 00000000000..c8e64d4e0e0 --- /dev/null +++ b/compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt @@ -0,0 +1,10 @@ +package test + +public trait A { + fun bar(): T + fun foo(): T = bar() +} + +public class B : A { + override fun bar() = "" +} diff --git a/compiler/testData/loadKotlin/class/InheritSubstitutedMethod.txt b/compiler/testData/loadKotlin/class/InheritSubstitutedMethod.txt new file mode 100644 index 00000000000..f8220df53ad --- /dev/null +++ b/compiler/testData/loadKotlin/class/InheritSubstitutedMethod.txt @@ -0,0 +1,12 @@ +package test + +public trait A { + internal abstract fun bar(): T + internal open fun foo(): T +} + +public final class B : test.A { + /*primary*/ public constructor B() + internal open override /*1*/ fun bar(): jet.String + internal open override /*1*/ /*fake_override*/ fun foo(): jet.String +} diff --git a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java index 5c32db7fb29..89e993dc3e8 100644 --- a/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/jvm/compiler/LoadCompiledKotlinTestGenerated.java @@ -128,6 +128,11 @@ public class LoadCompiledKotlinTestGenerated extends AbstractLoadCompiledKotlinT doTestWithAccessors("compiler/testData/loadKotlin/class/InheritClassWithParam.kt"); } + @TestMetadata("InheritSubstitutedMethod.kt") + public void testInheritSubstitutedMethod() throws Exception { + doTestWithAccessors("compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt"); + } + @TestMetadata("InheritTraitWithParam.kt") public void testInheritTraitWithParam() throws Exception { doTestWithAccessors("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt");